← Latest papers
💻 computer science

No Test Cases, No Problem: Distillation-Driven Code Generation for Scientific Workflows

MOSAIC is a training-free, multi-agent framework designed for scientific code generation that overcomes the lack of I/O test cases by using a student-teacher knowledge distillation approach and a Consolidated Context Window to ensure reasoning consistency and numerical precision.

Original authors: Siddeshwar Raghavan, Tanwi Mallick

Published 2026-04-28
📖 4 min read☕ Coffee break read

Original authors: Siddeshwar Raghavan, Tanwi Mallick

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 Problem: The "Chef Without a Recipe" Dilemma

Imagine you are a world-class chef, and someone hands you a mysterious, exotic ingredient you’ve never seen before—let's say a "Quantum Truffle." They ask you to cook a five-course meal using it.

In normal cooking (like competitive programming), you have a recipe card that says: "If you add salt and heat, the result should taste exactly like this specific sauce." If your sauce tastes wrong, you know immediately because you have a "test case" (the target flavor) to compare it to. You can keep adjusting until it's perfect.

But scientific coding is different. In science, there is no recipe card. There is no "target flavor" because the whole point of the experiment is to discover what the flavor is! If you try to cook the meal and it tastes weird, you don't know if the ingredient is actually weird or if you just messed up the cooking. This is the "deadlock" the researchers found: You can't check if your code is right if you don't already know the answer.


The Solution: MOSAIC (The Master & The Apprentice)

The researchers created a system called MOSAIC. Instead of trying to "taste the sauce" to see if it's right, they use a clever teaching method called Knowledge Distillation.

Think of MOSAIC as a high-end culinary academy consisting of four specialized characters:

1. The Master Teacher (Self-Reflection Agent)

Before any cooking starts, the Master Teacher looks at a few successful meals from the past. They don't just look at the final dish; they write down a very detailed, step-by-step "logic diary" of why the meal worked. They study the philosophy of the ingredients so they can create a "Guidance Manual" for the students.

2. The Planner (Rationale Agent)

This is the student who reads the Master's manual. When a new, mysterious ingredient arrives, the Planner doesn't just start throwing things in a pan. They sit down and write a detailed plan: "First, I will prep the base, then I will stabilize the temperature, then I will add the truffle."

To keep the student from getting overwhelmed by a massive 50-step recipe, they use something called the Consolidated Context Window (CCW). Imagine this as a "Sticky Note System." Instead of carrying a massive, heavy cookbook that makes them trip and forget what they're doing, the student only carries small sticky notes that say: "Step 1 is done; the sauce is now liquid." This keeps them focused on the present moment without losing the big picture.

3. The Sous-Chef (Coding Agent)

The Sous-Chef takes that perfect plan and actually does the heavy lifting—writing the actual code (the "cooking"). They follow the plan strictly, turning the logic into a working program.

4. The Kitchen Inspector (Debugger Agent)

Finally, the Inspector comes in. But here’s the catch: the Inspector isn't allowed to taste the food (because they don't know what it should taste like). Instead, they only check for kitchen safety and basic rules. They check: "Is the stove on? Is the pan cracked? Did you use a spoon instead of a fork?" In technical terms, they fix "syntax errors"—making sure the code actually runs without crashing—even if they can't tell if the math is 100% perfect yet.


Why does this matter?

By separating the "Logic" (the flavor/math) from the "Syntax" (the kitchen rules), MOSAIC allows AI to solve incredibly complex scientific problems in physics, chemistry, and biology where there are no "answer keys" available.

The Result: In their tests, MOSAIC was significantly better at solving these "mystery ingredient" problems than standard AI, proving that even when you don't know the answer, you can still find it if you have a great teacher, a clear plan, and a focused mind.

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 →