LLMs program using Reusable and Composable Abstract Representations
Not on the map. Why?
Abstract (arXiv)
When writing code, the same computation can be expressed in different programming languages and through different implementation strategies. We show that the activations of LLMs capture this shared structure in reusable and composable abstract representations when they generate code. These representations emerge in the middle layers, are reusable across programming languages, and afford the model an impressive amount of generalization ability when generating code under various interventions. Using activation steering, we show that function, programming language, and implementation strategy can be independently manipulated. The independent interventions on language and function can be flexibly composed to control code generation, even in cases when the prompt contains no information about language and function. We additionally find that finetuning on examples of arbitrarily defined functions in one programming language transfers to other languages, consistent with the models reusing abstract features of code generation that are shared across different examples. Finally, to study how such abstract representations come to be, we implement a minimal model of shared, reusable, and composable structure in a synthetic setting, and show that transformers trained on such data learn representations that reuse these parts flexibly across contexts.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 31 of its 36 references that are in the map. First posted on arXiv 13 Oct 2026.
Builds on
31 of 36 references.
References · 31
- 2017Attention Is All You Needcited by 60,361
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2023Qwen Technical Reportcited by 3,344
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
- 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,085
- 2023Steering Language Models With Activation Engineeringcited by 922
- 2015A Neural Algorithm of Artistic Stylecited by 483
- 2023In-Context Learning Creates Task Vectorscited by 312
- 2023Function Vectors in Large Language Modelscited by 308
- 2026Gemma 4 Technical Reportcited by 259
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 245
- 2022Extracting Latent Steering Vectors from Pretrained Language Modelscited by 225
19 more
- 2024Improving Instruction-Following in Language Models through Activation Steeringcited by 160
- 2025RWKV-7 "Goose" with Expressive Dynamic State Evolutioncited by 141
- 2024Transformers represent belief state geometry in their residual streamcited by 77
- 2024Separating Tongue from Thought: Activation Patching Reveals Language-Agnostic Concept Representations in Transformerscited by 44
- 2023Emergent Representations of Program Semantics in Language Models Trained on Programscited by 30
- 2024IRCoder: Intermediate Representations Make Language Models Robust Multilingual Code Generatorscited by 23
- 2024Vision-Language Models Create Cross-Modal Task Representationscited by 15
- 2025Do different prompting methods yield a common task representation in language models?cited by 11
- 2025KV Cache Steering for Controlling Frozen LLMscited by 11
- 2026Differential syntactic and semantic encoding in LLMscited by 7
- 2026Transformers learn factored representationscited by 7
- 2025Neural networks leverage nominally quantum and post-quantum representationscited by 6
- 2023Cross-lingual Transfer in Programming Languages: An Extensive Empirical Studycited by 5
- 2024Understanding How CodeLLMs (Mis)Predict Types with Activation Steeringcited by 5
- 2023Language Agnostic Code Embeddingscited by 4
- 2025Vector Arithmetic in Concept and Token Subspacescited by 4
- 2026Parallel-SFT: Improving Zero-Shot Cross-Programming-Language Transfer for Code RLcited by 2
- 2026Steering Code LLMs with Activation Directions for Language and Library Controlcited by 1
- 2026Syntax Without Semantics: Teaching Large Language Models to Code in an Unseen Languagecited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
- 2025On Code-Induced Reasoning in LLMs
- 2025Rewriting Pre-Training Data Boosts LLM Performance in Math and Code
- 2026Detecting Functional Memorization in Code Language Models
- 2025Functional Consistency of LLM Code Embeddings: A Self-Evolving Data Synthesis Framework for Benchmarking
- 2023CRAFT: Customizing LLMs by Creating and Retrieving from Specialized Toolsets
- 2025code_transformed: The Influence of Large Language Models on Code
- 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanations