← Latest papers
💬 NLP

MILES: Modular Instruction Memory with Learnable Selection for Self-Improving LLM Reasoning

MILES is a novel framework for self-improving LLM reasoning that dynamically expands a modular memory of step-wise instruction pairs and employs a coarse-to-fine, learnable selection mechanism to optimize memory composition and reasoning accuracy under realistic test-time constraints.

Original authors: Ruilin Tong, Dong Gong

Published 2026-07-09
📖 6 min read🧠 Deep dive

Original authors: Ruilin Tong, Dong Gong

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

The Big Picture: The "Smart Notebook" for AI

Imagine you have a brilliant but stubborn friend (the AI) who is great at solving puzzles but has a terrible memory. Every time you ask them a new math problem, they act like they've never seen one before. They solve it, but if you ask a similar question later, they have to start from scratch.

Usually, to make this friend smarter, you'd have to send them back to school for years to relearn everything (this is called "training" or updating the model's parameters). But what if your friend is a closed book that you can't send back to school? You can't change their brain.

MILES is a new way to help this friend get smarter while they are working, without changing their brain. It gives them a dynamic, learnable notebook that they can write in and consult in real-time.

The Problem with Old Notebooks

Previous attempts to give AI a "memory" had two main flaws:

  1. The "Whole Solution" Notebook: Some methods stored entire answers to past problems. If you asked a question that was 90% similar to an old one, it worked great. But if the question was slightly different (a "novel" problem), the old answer was useless. It was like trying to use a recipe for "Apple Pie" to bake a "Blueberry Muffin."
  2. The "Heuristic" Notebook: Other methods stored small steps (like "divide by 2" or "check the units"). But the AI had to guess which step to use next by just looking at how similar the words were. It was like a chef grabbing a random spice jar because the label looked similar to the one they needed, hoping for the best.

The MILES Solution: A "Modular" and "Learnable" System

MILES changes the game by treating reasoning like a Lego set rather than a single block of concrete.

1. The Building Blocks: "Sub-goals" and "Sub-instructions"

Instead of storing whole answers, MILES breaks problems down into tiny, reusable Lego bricks.

  • The Sub-goal (The Label): A short description of what needs to be done next (e.g., "Simplify the fraction").
  • The Sub-instruction (The Brick): A specific, natural-language tip on how to do it (e.g., "Divide the top and bottom numbers by their greatest common divisor").

Think of this as a toolbox where every tool has a clear label.

2. The "Smart Selector" (The Learnable Head)

This is the magic part. In the past, the AI just grabbed the tool that looked most similar to the current problem. MILES gives the AI a personal assistant (a "selection head") for every single tool in the toolbox.

  • How it learns: When the AI solves a problem confidently (it gets the answer right), MILES looks back at the steps it took. It asks: "Hey, when we used the 'Simplify Fraction' tool, did it help us get the right answer?"
  • The Training: If the answer is "Yes," the assistant learns to trust that tool for similar situations. If the answer is "No," the assistant learns to avoid it.
  • No School Needed: The AI's brain stays frozen. Only these tiny "assistants" (which are very small computer programs) get updated.

3. The Two-Step Search Process

When the AI faces a new problem, MILES uses a "Coarse-to-Fine" search, like looking for a book in a library:

  • Layer 1 (The Rough Search): The AI quickly scans the labels (Sub-goals) to find a few promising tools. It's like walking down the "Math" aisle and grabbing a few books that might be relevant.
  • Layer 2 (The Expert Review): The "assistants" (selection heads) take those few candidates and give them a score based on their past experience. "Wait, this tool worked great for algebra but failed for geometry. Let's pick the other one."

How It Works in Real Time (The "Confident vs. Uncertain" Flow)

The system operates in two modes depending on how sure the AI is:

  1. The "Confident" Mode (Learning Phase):
    If the AI solves a problem easily and gets the right answer, it treats this as a "training session." It breaks down its successful steps, saves them as new Lego bricks in the notebook, and teaches its assistants which tools worked best. The notebook grows richer with every success.

  2. The "Uncertain" Mode (Helping Phase):
    If the AI is stuck or unsure, it stops guessing. Instead, it opens the notebook, asks its assistants for advice, and uses the best tools to guide its thinking. It's like a student raising their hand to ask the teacher for a hint when they are stuck.

Why This Matters (The Results)

The paper tested MILES on hard math and science exams (like AIME and MATH-500).

  • Better Accuracy: It consistently solved more problems correctly than other methods that use memory or search.
  • Efficiency: It didn't waste as much computing power trying random guesses; it used the "learned" memory to pick the right path faster.
  • Transferability: The notebook built by one AI model could actually help a different AI model solve problems. It's like if a master chef wrote a cookbook that a junior chef could pick up and use immediately, even if they had never met.

Summary Analogy

Imagine you are playing a video game.

  • Old Way: You try to beat every level by guessing. If you die, you restart.
  • Previous Memory Way: You keep a list of "Winning Strategies" for specific levels. If you see Level 5, you use the Level 5 strategy. If you see Level 5.1, you are stuck.
  • MILES Way: You keep a dynamic strategy guide that updates itself. When you beat a level, the guide automatically writes down exactly which move worked best for that specific situation. Next time you face a tricky jump, the guide doesn't just show you a list; it has a "smart filter" that says, "Based on your past wins, the 'Double Jump' move is 90% likely to work here."

MILES allows AI to accumulate experience and get smarter over time, not by retraining its brain, but by learning how to better use its own growing library of tips and tricks.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →