paper-with-me

홈 › Papers

What's the Magic Word? A Control Theory of LLM Prompting

2023-10-02 · Aman Bhargava, Cameron Witkowski, Shi-Zhuo Looi, Matt Thomson

Prompt engineering is crucial for deploying LLMs but is poorly understood mathematically. We formalize LLM systems as a class of discrete stochastic dynamical systems to explore prompt engineering through the lens of control theory. We offer a mathematical analysis of the limitations on the controllability of self-attention as a function of the singular values of the parameter matrices. We present complementary empirical results on the controllability of a panel of LLMs, including Falcon-7b, Llama-7b, and Falcon-40b. Given initial state $\mathbf x_0$ from Wikitext and prompts of length $k \leq 10$ tokens, we find that the "correct" next token is reachable at least 97% of the time, and that the top 75 most likely next tokens are reachable at least 85% of the time. Intriguingly, short prompt sequences can dramatically alter the likelihood of specific outputs, even making the least likely tokens become the most likely ones. This control-theoretic analysis of LLMs demonstrates the significant and poorly understood role of input sequences in steering output probabilities, offering a foundational perspective for enhancing language model system capabilities.

📄 PDF Abstract BibTeX arXiv:2310.04444

Code (1)

amanb2000/magic_words 공식 구현 pytorch

Tasks

Causal Language ModelingLanguage ModelingLanguage ModellingPrompt Engineering

Similar Papers 제목 키워드 기반

Function Words in Authorship Attribution. From Black Magic to Theory?

2014-04-01 · WS 2014 4 · Mike Kestemont
Authorship Attribution

Editorial introduction: The power of words and networks

2021-05-24 · A. Fronzetti Colladon, P. Gloor, D. F. Iezzi

According to Freud "words were originally magic and to this day words have retained much of their ancient magical power". By words, behaviors are transformed and problems are solved. The way we use words reveals our inte…

ArticlesManagement

MAGIC-Enhanced Keyword Prompting for Zero-Shot Audio Captioning with CLIP Models

2025-09-16 · Vijay Govindarajan, Pratik Patel, Sahil Tripathi, Md Azizul Hoque 외 arxiv

Automated Audio Captioning (AAC) generates captions for audio clips but faces challenges due to limited datasets compared to image captioning. To overcome this, we propose the zero-shot AAC system that leverages pre-trai…

Zero-shot Audio CaptioningImage Captioning

Jailbreaking LLMs' Safeguard with Universal Magic Words for Text Embedding Models

2025-01-30 · Haoyu Liang, Youran Sun, Yunfeng Cai, Jun Zhu 외

The security issue of large language models (LLMs) has gained wide attention recently, with various defense mechanisms developed to prevent harmful output, among which safeguards based on text embedding models serve as a…

MAGICS: Adversarial RL with Minimax Actors Guided by Implicit Critic Stackelberg for Convergent Neural Synthesis of Robot Safety

2024-09-20 · Justin Wang, Haimin Hu, Duy Phuong Nguyen, Jaime Fernández Fisac

While robust optimal control theory provides a rigorous framework to compute robot control policies that are provably safe, it struggles to scale to high-dimensional problems, leading to increased use of deep learning fo…

OpenAI GymReinforcement Learning (RL)