← Latest papers
💻 computer science

Context Matters: Evaluating Context Strategies for Automated ADR Generation Using LLMs

This paper demonstrates that for automated Architecture Decision Record (ADR) generation using Large Language Models, strategically selecting a small window of recent historical context (typically 3–5 records) is more effective for balancing quality and efficiency than relying on model scale or complex retrieval-based strategies.

Original authors: Aviral Gupta, Rudra Dhar, Daniel Feitosa, Karthik Vaidhyanathan

Published 2026-04-16
📖 5 min read🧠 Deep dive

Original authors: Aviral Gupta, Rudra Dhar, Daniel Feitosa, Karthik Vaidhyanathan

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 Problem: The "Forgotten Notebook"

Imagine you are building a massive, complex Lego castle. Every time you make a big decision—like "We need a red tower here because the blue one is too wobbly"—you write it down in a notebook. This notebook is called an Architecture Decision Record (ADR).

In the real world of software, these notebooks are crucial. They tell future builders why the castle looks the way it does. But here's the problem: writing these notes is boring and takes time. Architects often skip them, or they write them poorly, leaving future teams confused. It's like trying to fix a car without knowing what the previous mechanic did.

The Solution: The AI Assistant

The researchers asked: Can an AI (a Large Language Model or LLM) write these notes for us?

They knew AI is good at writing, but they suspected the AI might be "hallucinating" (making things up) if it didn't know the history of the project. So, they ran a massive experiment to see how much history the AI needs to read before it can write a good note.

The Experiment: The "Time Travel" Test

The researchers gathered 750 real-world software projects and over 4,500 real notes. They then asked the AI to write a new note for a project, but they gave the AI different "time capsules" of history to read.

They tested five different strategies:

  1. The Amnesiac (No Context): The AI is given the title of the new decision but nothing else. It has to guess the rest.
    • Result: It wrote long, rambling, generic stories that didn't fit the specific project. Like a tourist guessing the rules of a local game without watching anyone play.
  2. The Hoarder (All History): The AI reads every single note ever written for that project, from day one to yesterday.
    • Result: It did a good job, but it was slow, expensive, and sometimes got confused by old, irrelevant notes (like reading a 10-year-old diary entry while trying to decide what to wear today).
  3. The Historian (First-K): The AI only reads the first few notes (the foundational decisions).
    • Result: It understood the basics but missed recent changes. It was like knowing the foundation of a house but not knowing that the roof was replaced last week.
  4. The Gossip (Last-K): The AI only reads the last 3 to 5 notes.
    • Result: This was the winner. It produced the best notes, almost as good as reading everything, but much faster and cheaper. It realized that what happened yesterday matters more than what happened ten years ago.
  5. The Detective (RAFG): The AI uses a smart search to find notes that are conceptually similar, even if they are old.
    • Result: This was great for weird, complex situations where a decision from 2 years ago is still relevant today. But for most normal days, it was overkill and didn't beat the "Gossip" strategy.

The Big Discoveries (The "Aha!" Moments)

1. Context is King, Not Model Size
You might think you need the most expensive, super-smart AI to write good notes. The study found that even a smaller, cheaper AI could write amazing notes if it was given the right context (the last 3-5 notes).

  • Analogy: It's not about having a genius student; it's about giving them the right textbook. A smart student with no book will fail, but a regular student with the right book will ace the test.

2. The "Sweet Spot" is Small
You don't need to read the whole library to write a good summary. Reading the last 3 to 5 entries was usually enough.

  • Analogy: If you want to know the plot of a TV show, you don't need to watch every episode from Season 1. You just need to watch the last few episodes to understand what's happening right now.

3. The "External Link" Trap
The researchers noticed that when human-written notes said, "See our Wiki for details," the AI struggled. The AI tried to write a full explanation, but the "score" was low because it didn't match the short note that just said "See Wiki."

  • Analogy: If a human says, "Ask the librarian," and the AI writes a whole paragraph about the book, the AI gets a bad grade for not matching the short note, even though the AI actually did the hard work of explaining it! This shows that bad human habits (hiding info in links) make it hard to measure if the AI is doing a good job.

What Should We Do? (The Takeaway)

If you are building a tool to help software teams write these notes automatically:

  • Don't feed the AI the whole history. It's too much noise.
  • Give it the last 3 to 5 notes. This is the "Goldilocks" zone—just right.
  • Don't worry about buying the most expensive AI. A smaller, local AI works just fine if you give it the right context.
  • Fix your own notes first. If your team hides information in external links, the AI can't help you. You need to write self-contained notes.

In a Nutshell

The paper proves that how you talk to the AI matters more than how "smart" the AI is. By giving the AI a small, recent slice of history (the last few decisions), we can automate the boring work of documentation without needing supercomputers or reading the entire history of the project. It's about giving the AI the right context, not just a bigger brain.

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 →