Compositional Generalization in Autoregressive Models via Logit Composition
This paper introduces a principled logit composition strategy for autoregressive models, inspired by diffusion methods, which ensures projective control over output subspaces and preserves length generalization under factorized-conditionals assumptions.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a team of three very specific chefs working in a kitchen.
- Chef Base (The Background): This chef is great at following the recipe exactly as written. If you ask for a plain sandwich, they make a perfect plain sandwich. They don't add anything extra.
- Chef Math: This chef is a wizard at adding cheese and spices, but only if the recipe calls for it. If the recipe says "add cheese," they do it perfectly. If it doesn't, they leave the sandwich alone.
- Chef Code: This chef is an expert at adding lettuce and tomatoes, but only when the recipe asks for it.
The Problem:
Usually, if you want a sandwich with both cheese and lettuce, you have to hire one giant chef who knows how to do everything at once. Or, you try to mix the three chefs together by blending their aprons (weights) or telling them to take turns (routing). But often, this causes chaos: Chef Math might try to add cheese when Chef Code is trying to add lettuce, or they might argue over how to finish the sandwich, resulting in a messy, inedible pile of food.
The Paper's Solution: "Logit Composition"
The authors of this paper propose a new way to combine these chefs. Instead of blending their aprons or making them take turns, they let all three chefs shout out their suggestions for the next ingredient at the same time, but with a special rule:
- The Rule: They take Chef Math's suggestion, add Chef Code's suggestion, and then subtract Chef Base's suggestion.
- The Magic: Because Chef Base is just the "plain" version, subtracting their voice cancels out the noise.
- When the recipe needs cheese, Chef Math is loud, Chef Code is quiet (because they don't know about cheese), and Chef Base is neutral. The math works out so that the final decision is "Add Cheese."
- When the recipe needs lettuce, Chef Code is loud, Chef Math is quiet, and Chef Base is neutral. The final decision is "Add Lettuce."
- When the recipe needs nothing special, everyone is quiet, and the sandwich stays plain.
Why This Works (The "Disjoint" Secret)
The paper argues that this only works perfectly if the chefs have disjoint jobs.
- Chef Math only touches the "cheese steps."
- Chef Code only touches the "lettuce steps."
- They never try to do the other's job at the same time.
If Chef Math tries to add cheese while Chef Code is adding lettuce, they might crash into each other. But if they know exactly when to act (e.g., "I only act on step 3, you only act on step 5"), they can work together seamlessly without fighting. The paper calls this "Factorized Conditionals."
The "Projective" Guarantee
The paper proves that if the chefs stick to their specific zones, the final sandwich (the output) will be exactly what you'd get if you had hired a super-chef who knew both skills perfectly.
- The "Cheese" part of the sandwich comes 100% from Chef Math.
- The "Lettuce" part comes 100% from Chef Code.
- The "Bread" part comes 100% from Chef Base.
They don't interfere with each other. It's like a projection: if you look at just the cheese part, it looks exactly like Chef Math made it. If you look at the lettuce, it looks exactly like Chef Code made it.
Does it work for long recipes? (Length Generalization)
The paper also checked if this works for very long recipes (like a 100-page cookbook) that the chefs haven't seen before. They found that as long as the chefs know their specific "zones" (e.g., "I handle steps 10–20") and the recipe follows the same pattern, the combined team can handle the long recipe just as well as the short one. They don't get confused just because the book is thicker.
Real-World Test
The authors tested this with real AI models (Large Language Models):
- They took a base model (Gemma 2).
- They took a version fine-tuned for Math.
- They took a version fine-tuned for Coding.
- They combined them using their "shout-out" rule.
The Result:
The new combined model got better at coding than the coding expert alone, and it kept almost all of the math expert's skills. It didn't lose its math ability just because it learned to code. It was a "best of both worlds" situation without needing to retrain the whole team from scratch.
The Catch
The paper admits this works best when the tasks are clearly separated. If you try to combine too many experts (like adding a "Poetry" chef and a "History" chef to the mix), the team might get confused about when to stop talking, leading to gibberish. But for clear, separate skills, this "Logit Composition" is a powerful, principled way to build modular AI systems.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.