Showing posts with label LLMs. Show all posts
Showing posts with label LLMs. Show all posts

Sunday, March 8, 2026

Steering Large Language Models: Shaping Behavior at Inference Time

 

Introduction

The dominant paradigm for customizing a Large Language Model (LLM) has long revolved around two techniques:

·       fine-tuning (retraining the model on new data to alter its weights) and

·       prompt engineering (carefully crafting inputs to elicit desired outputs).

Both have proven powerful, but both carry meaningful limitations. Fine-tuning is expensive, requires labeled data, and can cause catastrophic forgetting. Prompt engineering is brittle, easily bypassed, and opaque - it shapes what the model sees, not what it fundamentally does.

A third approach has emerged that operates differently from either: activation steering, also called representation engineering or simply steering. Rather than changing the model's weights or its inputs, steering intervenes directly in the model's internal computational state during a forward pass. It reaches inside the model's residual stream - the flowing, high-dimensional representation of meaning that passes between transformer layers and nudges it in a direction associated with a target concept, behavior, or personality trait.

The result is a model whose outputs are shaped from within, in real time, without any modification to its parameters and without any mention of the intended behavior in the prompt.

Steering operates directly on the model’s hidden states or activations.

·       You’re not changing what the model knows.

·       You’re influencing how it uses what it knows.

Steering is especially powerful when:

  • You want real-time personality switching
  • You need strong behavioral guarantees
  • You want low-latency adjustments
  • You must avoid retraining for compliance reasons
  • You operate at scale with shared base models

In short: steering enables programmable cognition.

How LLMs Represent Meaning Internally

To understand steering, it helps to understand what is actually happening inside a transformer model when it processes text.

At each layer of a transformer, the model maintains a residual stream: a vector of floating-point numbers (often thousands of dimensions wide) for each token in the sequence. This vector accumulates information as it passes through attention heads and feed-forward networks at successive layers. By the final layer, this representation encodes everything the model "knows" about that token in context — its meaning, its emotional valence, its relation to prior tokens, and more.

Research in mechanistic interpretability has demonstrated that these high-dimensional vectors are not random or uninterpretable. Specific directions in this space correspond to identifiable concepts. A direction might encode "this text is formal," another might encode "this statement is a refusal," another might correspond to "the speaker is angry." These directions are often linearly separable - meaning you can find a vector that, when added to or subtracted from a layer's activations, reliably shifts the model's behavior along a conceptual axis.

This is the foundation of steering.

What Is a Steering Vector?

A steering vector is a direction in a model's activation space that corresponds to a particular concept, behavior, or personality trait. Once identified, adding a scaled version of this vector to the model's residual stream at one or more layers during inference shifts the model's outputs toward (or away from) that concept - without any change to weights or prompts.

How Steering Vectors Are Extracted

The most common method for extracting a steering vector is the contrast pair approach:

  1. Collect contrast pairs. Prepare a set of input prompts that differ only in the presence or absence of the target concept. For example, to find a "sycophancy" direction, you might collect outputs where the model agrees with a false statement (sycophantic) versus outputs where it corrects the record (honest).
  2. Record activations. Run both sets of inputs through the model and record the residual stream activations at a chosen layer (or set of layers) for each.
  3. Compute the difference. Subtract the mean activation of the "without" class from the mean activation of the "with" class. The resulting vector is the steering direction for that concept.
  4. Normalize. Scale the vector to unit norm. At inference time, it can be multiplied by a scalar coefficient (the steering strength) to control the magnitude of the intervention.

This approach is also called activation addition.

An alternative is probing: training a linear classifier on activations to distinguish between two classes, then using the classifier's weight vector as the steering direction. This is slightly more principled but also more data-hungry.

The Mechanics of Steering at Inference

At inference time, steering works as follows:

  1. The model begins a standard forward pass on the input tokens.
  2. At a designated layer (e.g., layer 15 of a 32-layer model), the residual stream activations are intercepted.
  3. A scaled steering vector is added to (or subtracted from) the activation at that layer for every token (or a selected subset of tokens).
  4. The modified activations continue through the rest of the forward pass as normal.
  5. The model generates its output based on this modified internal state.

This is sometimes called representation intervention because it intervenes directly in the model's representation, rather than in its inputs or weights.

The layer choice matters considerably. Early layers tend to encode surface-level syntactic features; middle layers tend to encode semantic concepts; late layers encode task-specific, generation-oriented information. Steering for behavioral traits often works best in mid-to-late layers.

The steering strength (the scalar multiplier on the vector) controls intensity. Low values produce subtle nudges; high values can dramatically alter tone, content, or even coherence. Too strong a vector can destabilize the model's outputs entirely, causing incoherence or repetitive loops.

Concrete Examples

Example 1: Steering for Happiness / Emotional Tone

Setup: Using a contrast set of "happy" vs. "neutral" text completions, researchers extract a "happiness" vector from layer 20 of a GPT-2 style model.

At inference:

  • Prompt: "The weather outside is"
  • Without steering: "...cloudy and cold, with rain expected through the evening."
  • With +happiness steering: "...absolutely beautiful -  warm sunshine, a gentle breeze, and the kind of day that makes everything feel possible."
  • With -happiness steering: "...grim and oppressive, the kind of grey that seeps into your bones and reminds you nothing lasts."

The prompt is identical in all three cases. Only the internal state differs.

Example 2: Suppressing Refusals (Safety Research Context)

This example is documented in the interpretability literature and is studied precisely because of its safety implications.

Setup: Researchers identify a "refusal" direction in models trained with RLHF safety fine-tuning by contrasting activations on prompts that elicit refusals versus prompts that elicit helpful completions.

Finding: Subtracting this direction from the residual stream can suppress the model's tendency to refuse certain requests — even requests that would normally trigger a safety response. This does not mean the model "has no values," but rather that the safety behavior is partly implemented as a localized direction in activation space that can be disrupted.

Implication for safety research: This finding motivates designing safety behaviors that are more distributed across the model's computation, rather than concentrated in a single linear direction that could be easily steered away.

Example 3: Personality and Communication Style

Setup: A product team wants a customer-facing assistant to be consistently warm, empathetic, and informal -  without relying on a long system prompt that could be easily manipulated or overridden.

Method: They extract a "warmth" vector from a set of contrast pairs:

  • Warm responses: "Oh, I completely understand how frustrating that must be! Let's sort this out together."
  • Cold/neutral responses: "Your issue has been logged. A representative will respond within 48 hours."

They then apply a moderate positive scalar of this vector at layers 16–20 of their deployed model.

Result: Every completion the model produces - regardless of topic - carries a slightly warmer, more empathetic register. The effect is consistent, doesn't consume context window, and cannot be bypassed by adversarial prompts the way system prompt instructions can.

Example 4: Reducing Sycophancy

One of the most-studied applications of steering in alignment research is sycophancy reduction - making models less likely to agree with false or biased claims simply because the user asserted them.

Setup: Contrast pairs are constructed as:

  • Sycophantic: Model agrees with a user who confidently states a false fact ("You're right, Napoleon was over 6 feet tall")
  • Honest: Model politely corrects the user

Steering application: Adding the "honest" direction (or subtracting the "sycophantic" direction) during inference increases the model's tendency to maintain accurate positions even under social pressure.

Result: In evaluations, steered models are significantly less likely to update their stated beliefs when users push back with false confidence - a behavior that can erode the utility and trustworthiness of deployed assistants.

Example 5: Concept Injection Without In-Context Examples

Traditional in-context learning requires including examples of the desired behavior directly in the prompt. Steering can replicate some of this without using prompt tokens.

Setup: A researcher wants a model to respond as if it is in a "formal academic writing" mode.

Method: Rather than adding instructions like "Write in a formal academic tone" to the prompt (which costs tokens and can be ignored), they extract a "formal academic register" vector and apply it at inference.

Result: Even a bare prompt like "Explain photosynthesis" yields a response that reads like a textbook entry, with appropriate hedging, citation-style language, and structured argumentation — purely due to the internal steering, with no prompt modification.

Steering vs. Other Approaches: A Comparison

Dimension

Fine-Tuning

Prompt Engineering

Activation Steering

Modifies weights?

Yes

No

No

Requires training data?

Yes

No

Small contrast set

Consumes context window?

No

Yes

No

Bypassable by adversarial prompts?

Somewhat

Easily

Much harder

Interpretable?

Low

Medium

High

Requires redeployment?

Yes

No

No

Precision of control?

Broad

Narrow

Medium

Risk of destabilization?

Low

Very low

Medium (at high strength)

 

Limitations and Challenges

Steering is powerful, but it is not without significant limitations.

Instability at high magnitudes. Steering vectors applied with too large a coefficient can collapse model outputs into incoherence, repetition, or nonsensical text. The relationship between steering strength and output quality is nonlinear and model-dependent.

Layer sensitivity. The optimal layer for applying a steering vector varies by concept and by model architecture. What works at layer 16 may fail at layer 10 or layer 22. This requires empirical tuning.

Interference between vectors. Applying multiple steering vectors simultaneously can produce unpredictable interactions, since the vectors may not be orthogonal in activation space.

Polysemy of directions. A direction identified for "concept A" may also carry information about "concept B" if the two are correlated in the training data. Steering for one can inadvertently amplify or suppress the other.

Generalization limits. Steering vectors extracted from one distribution of prompts may not generalize perfectly to all prompts. A "happy" direction extracted from descriptive text may behave differently when applied to instructions or code.

Adversarial robustness is not guaranteed. While harder to bypass than prompt-based defenses, steering vectors can in principle be identified and countered by a sufficiently sophisticated adversary with white-box access to the model.

Ethical dual-use. The same techniques that enable safety researchers to identify and reinforce beneficial behaviors can be used to suppress them. A "refusal suppression" vector is a useful tool for auditing safety mechanisms and also a potential tool for circumventing them.

Risks

·       Requires Model Access

You need access to hidden states.
Closed APIs rarely allow this.

·       Trade-Off Curves

Strong steering can:

·        Reduce fluency

·        Increase verbosity

·        Harm reasoning quality

There is always a tuning coefficient.

·       Interpretability Is Imperfect

Activation space is high-dimensional.
Vectors may entangle multiple behaviors.

·       Security Concerns

If steering layers are exposed:

·        Malicious actors could override safety

·        Reverse-engineer control vectors

This requires architectural safeguards.                                                                                               

Strategic Implications

Steering changes the economics of AI deployment.

Instead of:

  • Maintaining multiple fine-tuned models

You can:

  • Maintain one base model
  • Apply runtime cognitive modulation

This reduces:

  • Training cost
  • Versioning complexity
  • Deployment risk

It also enables something bigger:

AI systems that are policy-configurable without retraining.

That’s a major shift in governance design.

Conclusion

Activation steering represents a fundamental shift in how we think about controlling the behavior of large language models. Rather than shaping outputs by modifying what a model is trained on, or by carefully constructing what it is told, steering shapes outputs by directly modifying what a model internally represents during inference.

It is, in a sense, the most direct form of behavioral control yet developed: not prompting a model to be honest, not training it to be honest, but reaching into the computational stream where honesty is encoded and amplifying that signal directly.

This directness makes steering both a powerful tool and a revealing window. The same technique that lets engineers reliably produce warmer, more honest, or less sycophantic outputs also exposes the degree to which LLM behaviors are localized, linear, and — for better or worse - surgically modifiable. Understanding these levers is not only a capability question. It is increasingly a safety question, and one of the most active frontiers in the science of making AI systems that behave as intended.

References and further reading:

·       Turner et al. (2023), "Activation Addition: Steering Language Models Without Optimization"

·       Zou et al. (2023), "Representation Engineering: A Top-Down Approach to AI Transparency"

·       Hernandez et al. (2023), "Linearity of Relation Decoding in Transformer Language Models"

·       Li et al. (2023), "Inference-Time Intervention: Eliciting Truthful Answers from a Language Model"

Thursday, February 5, 2026

The Boundaries of Large Language Models: Where AI Stops Working

Large language models (LLMs) have made remarkable progress, but they still have fundamental limitations due to their architecture, training data, and lack of certain cognitive abilities. Here are the key tasks LLMs cannot perform, along with the reasons why:

1. Tasks Requiring Real-World Interaction

Examples:

  • Physical actions: Operating machinery, conducting lab experiments, or performing surgery.
  • Real-time sensory perception: Seeing, hearing, or touching the physical world (e.g., identifying objects in a room or reacting to live audio).

Why? LLMs are text-in, text-out systems. They lack:

  • Embodiment: No sensors, actuators, or physical presence.
  • Real-time feedback loops: Cannot interact dynamically with environments outside of text or pre-processed data.

2. Tasks Requiring True Understanding or Consciousness

Examples:

  • Genuine comprehension: Understanding text the way humans do—with intent, emotions, or subjective experience.
  • Self-awareness: Recognizing its own existence, limitations, or desires.

Why? LLMs simulate understanding by predicting patterns in text. They:

  • Lack qualia (subjective experience) or theory of mind (understanding others’ mental states).
  • Cannot form beliefs, desires, or intentions -they generate responses based on statistical probabilities.

3. Tasks Requiring Up-to-Date or Private Knowledge

Examples:

  • Real-time information: Answering questions about events after the model’s last training update (e.g., “What happened in the stock market yesterday?”).
  • Accessing private data: Retrieving personal emails, internal company documents, or confidential databases.

Why? LLMs are static at the time of training. They:

  • Cannot browse the live web or access new data unless explicitly provided (e.g., via web search tools).
  • Have no memory of past interactions unless stored externally (e.g., chat history).

4. Tasks Requiring Complex Reasoning or Planning

Examples:

  • Multi-step logical puzzles: Solving novel math proofs or planning a multi-year business strategy with unknown variables.
  • Causal reasoning: Explaining why something happens at a deep, mechanistic level (e.g., “Why does this drug work at the molecular level?”).

Why? LLMs excel at pattern recognition, not structured reasoning. They:

  • Struggle with abstraction beyond surface-level correlations.
  • Cannot perform recursive self-improvement or hypothetical planning like humans.

Note: Tools like Wolfram Alpha or symbolic AI are often better for math/logic, while LLMs assist with explanations or generating hypotheses.

5. Tasks Requiring Ethical or Moral Judgment

Examples:

  • Making value-based decisions: Deciding what is “right” in ambiguous situations (e.g., medical triage, legal sentencing).
  • Aligning with human values: Resolving conflicts between cultural, personal, or societal norms.

Why? LLMs have no inherent values or ethics. They:

  • Reflect biases in training data.
  • Cannot justify decisions based on moral frameworks - only simulate what “sounds” ethical.

Example: An LLM might suggest a course of action, but it cannot feel empathy or take responsibility for outcomes.

6. Tasks Requiring Creativity Beyond Remixing

Examples:

  • Truly original art or ideas: Creating a groundbreaking scientific theory or a transformative art movement.
  • Inventing novel concepts: Designing a never-before-seen technology or philosophical framework.

Why? LLMs remix existing ideas—they don’t “invent” in the human sense. They:

  • Lack intentionality or purpose behind creation.
  • Rely on statistical novelty, not conceptual leaps.

Note: LLMs can assist creativity (e.g., brainstorming, drafting) but cannot replace human ingenuity.

7. Tasks Requiring Emotional Intelligence

Examples:

  • Genuine empathy: Comforting a grieving person with deep emotional understanding.
  • Negotiating complex social dynamics: Mediating a family conflict or leading a team through cultural change.

Why? LLMs simulate empathy using patterns from data. They:

  • Cannot experience emotions or build real relationships.
  • May generate plausible but hollow responses in sensitive contexts.

8. Tasks with High Stakes or Legal Accountability

Examples:

  • Medical diagnosis: Prescribing treatment without a doctor’s oversight.
  • Legal advice: Drafting binding contracts or representing someone in court.

Why? LLMs:

  • Are not certified or licensed professionals.
  • Cannot be held legally accountable for errors or omissions.

Best practice: Use LLMs as assistants, not replacements, for high-stakes tasks.

9. Tasks Requiring Long-Term Memory or Consistency

Examples:

  • Remembering user preferences: Recalling a user’s dietary restrictions across multiple sessions without external storage.
  • Maintaining narrative consistency: Writing a 1,000-page novel with coherent characters and plotlines over months.

Why? LLMs have no persistent memory. Each response is generated independently unless:

  • External tools (e.g., databases, vectors) store context.
  • Users provide repetitive reminders of past interactions.

10. Tasks Involving Unstructured or Noisy Data

Examples:

  • Analyzing raw sensor data: Interpreting live EEG brainwave signals or satellite imagery.
  • Processing ambiguous input: Understanding heavily accented speech or poorly scanned handwritten notes.

Why? LLMs are trained on clean, structured text. They:

  • Struggle with multi-modal data (e.g., combining text, audio, and video).
  • Require pre-processing for non-text inputs (e.g., OCR for images).

Solution: Hybrid systems (e.g., LLM + computer vision models) are often needed.

Summary Table: LLM Limitations

Task Type

Example

Why LLMs Fail

Workaround

Real-world interaction

Operating a robot

No sensors/actuators

Pair with robotics hardware

True understanding

Explaining consciousness

No subjective experience

Use as a research assistant

Up-to-date knowledge

Today’s news

Static training data

Integrate web search tools

Complex reasoning

Proving a math theorem

No symbolic logic

Combine with Wolfram Alpha or theorem provers

Ethical judgment

Deciding medical triage

No values or accountability

Use as a decision-support tool

Original creativity

Inventing a new physics theory

Remixes existing ideas

Assist human creators

Emotional intelligence

Counseling a trauma survivor

No genuine empathy

Augment with human oversight

High-stakes accountability

Diagnosing disease

No certification/liability

Use only under expert supervision

Long-term memory

Remembering user preferences

No persistent storage

Use external databases

Unstructured data

Analyzing live video feeds

Text-only input

Pair with specialized models (e.g., CV)

Key Takeaway

LLMs are powerful tools for text-based tasks - generating, summarizing, translating, and assisting - but they are not autonomous agents. For tasks requiring real-world action, deep reasoning, ethics, or creativity, LLMs should be part of a larger system (e.g., combined with humans, symbolic AI, or specialized tools).