← Latest papers
💬 NLP

CRAFT: Learn the Schema, Execute the Plan

CRAFT is a two-stage post-training framework for enterprise coding agents that learns schema-grounded planning and execution behaviors without exhaustive prompt-time schema injection, significantly improving analytical performance, consistency, and efficiency while reducing token overhead.

Original authors: Aakash Kolekar, Sahika Genc, Shahriar Shariat, Bunyamin Sisman, Tibor Mezi, Barbara Poblete, Shree Vandana Kachroo, Calvin Chi, Parth Parmar, Ari Singer, Prayaas Jain, Cindy Barker, Benoit Dumoulin

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

Original authors: Aakash Kolekar, Sahika Genc, Shahriar Shariat, Bunyamin Sisman, Tibor Mezi, Barbara Poblete, Shree Vandana Kachroo, Calvin Chi, Parth Parmar, Ari Singer, Prayaas Jain, Cindy Barker, Benoit Dumoulin

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 a world where you can talk to a super-smart robot assistant and ask it to do complex math, analyze huge piles of data, or write computer programs just by using plain English. This is the dream of "coding agents." But here's the catch: to do its job, this robot needs to know the secret rules of the database it's working with. Think of it like a chef trying to cook a gourmet meal. If the chef doesn't know what ingredients are in the pantry or how the stove works, they can't cook. In the past, to help the robot, engineers would shove a massive, dusty encyclopedia of every single rule, table name, and column definition right into the robot's brain every time it asked a question. It was like forcing the chef to read the entire encyclopedia before chopping a single onion. It was slow, expensive, and if the pantry changed even a little, the whole system would break.

Now, imagine if instead of reading the encyclopedia every time, the chef could just remember the layout of the kitchen after a few practice sessions. That's the big question this paper tackles: Can we teach these AI assistants to learn the rules of the database once and for all, so they don't need to be reminded of them every single time? The researchers wanted to see if they could train the AI to "internalize" the schema (the map of the data) and the tools it needs to use, making it faster, smarter, and less likely to get confused when the conversation gets long and complicated.


The Paper: CRAFT – Learning the Map, Then Running the Race

The paper introduces a new system called CRAFT (which stands for a two-stage recipe for learning). The authors, a team from Amazon, wanted to build an AI that could help advertising experts analyze their campaign data without drowning in technical details. They found that the old way of "stuffing" the AI's prompt with endless documentation was like trying to run a marathon while carrying a backpack full of bricks. It slowed everything down and made the AI prone to mistakes.

So, they tried a different approach: Learn the Schema, Execute the Plan.

Stage 1: The "Schema-Stripped" Classroom

First, they taught the AI in a special classroom where the "encyclopedia" was taken away. They gave the AI thousands of examples of how to solve problems, but they hid the raw database rules (the DDL) from the input. Instead of reading the rules, the AI had to learn the patterns of how to think and plan.

Think of it like teaching a student to solve a math problem by showing them the steps and the logic, but not letting them look at the formula sheet. They have to memorize the way to think. The researchers call this PLAN Supervised Fine-Tuning (SFT). It's like the AI is learning the "muscle memory" of how to structure a plan and write code, without needing the cheat sheet every time.

Stage 2: The "Reinforcement Learning" Gym

Once the AI had the basic muscle memory, they put it in a gym for Reinforcement Learning (RL). This is where the AI actually tries to run the code and use the tools. If it makes a mistake—like calling the wrong tool or writing code that crashes—it gets a "negative score." If it succeeds, it gets a "positive score."

The researchers used a special scoring system that didn't just care if the code ran; it cared if the code was good, if the plan matched the code, and if the AI could recover when things went wrong. It's like a coach watching a runner not just finish the race, but checking their form, their speed, and how they handle a stumble. This stage, called Execution-Shaped GRPO, taught the AI to be reliable and consistent, even when the user asked follow-up questions or changed the rules mid-conversation.

The Results: Faster, Smarter, and Less Cluttered

The results were pretty impressive. When they tested CRAFT against the old "backpack of bricks" method:

  • Speed: The new system reduced the amount of text (tokens) the AI had to read by about 9 times. That's a massive weight loss for the AI's brain.
  • Smarts: The overall "Agent Score" (a measure of how well it did the job) went up by 9.6 percentage points.
  • Consistency: The AI became 4.1 percentage points more consistent, meaning it gave the same good answer even if you asked the same question twice.
  • Less Confusion: It reduced the number of times the AI had to "search" for the right tool by up to 5 times.

The researchers also found that the AI got much better at handling multi-turn conversations. If a user said, "Show me the sales," and then followed up with, "Now filter for only the red shirts," the CRAFT AI remembered the context and kept the thread going, whereas the old system often got lost.

What It's Not (And What to Watch Out For)

It's important to note what this paper doesn't claim. The authors are very clear that this system is designed for stable, known schemas. If the database suddenly invents a completely new type of data or a brand-new tool that the AI has never seen, CRAFT might get stuck. It's like a chef who knows the kitchen perfectly but doesn't know how to use a brand-new, weird gadget they've never seen before. In those cases, you might still need to look up the rules (retrieval) or retrain the chef.

Also, the paper admits that while the AI is great at following the plan, it doesn't yet fully optimize for things like how much computer memory it uses or how much it costs to run on the server. That's a job for future upgrades.

The Bottom Line

CRAFT suggests that instead of constantly shoving information into an AI's face, we can teach it to learn the rules once and then trust it to execute the plan. By combining a "no-cheat-sheet" training phase with a "practice-and-get-corrected" phase, they built an agent that is lighter, faster, and more reliable. It's a step toward making AI assistants that feel less like robots reading a manual and more like expert colleagues who just know how the business works.

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 →