Thread: A Logic-Based Data Organization Paradigm for How-To Question Answering with Retrieval Augmented Generation

Kaikai An, Fangkai Yang, Liqun Li, Junting Lu, Sitao Cheng, Shuzheng Si, Lu Wang, Pu Zhao, Lele Cao, Qingwei Lin, Saravan Rajmohan, Dongmei Zhang, Qi Zhang, Baobao Chang · Submission to ICLR 2025 · Rejected

TL;DR

THREAD is a novel data organization paradigm that moves Retrieval-Augmented Generation (RAG) beyond simple fact-finding to complex problem-solving. By replacing arbitrary text "chunks" with "Logic Units" (LUs) that preserve procedural dependencies, THREAD significantly improves the success rate of AI agents on "how-to" tasks—such as technical troubleshooting and web navigation—by up to 33% while reducing the amount of retrieved information by 75%.

The Problem: The Chunking Bottleneck

Standard RAG systems are excellent at answering "5W" questions (Who, What, Where, When, Why). If you ask, "When was Shakespeare born?", the system can easily find a text chunk containing that fact. However, these systems struggle with "1H" questions—the "How-to" queries essential for decision-making and dynamic problem-solving.

The primary bottleneck is the chunk-based paradigm. Most RAG systems split documents into fixed-size segments (e.g., every 500 characters). For a complex manual or troubleshooting guide, this is akin to cutting a recipe into random pieces: you might retrieve the "bake for 20 minutes" instruction but lose the "preheat the oven" prerequisite or the "if the crust is brown, remove it" conditional logic. This disruption of logical coherence makes it nearly impossible for a Large Language Model (LLM) to guide a user through a multi-step, dynamic process.

Methods: Introducing Logic Units

To address this, the authors propose THREAD, a framework that organizes data into Logic Units (LUs) instead of arbitrary chunks.

The THREAD framework architecture, illustrating the transformation of documents into Logic Units and the dynamic retrieval process.

An LU is a structured, JSON-like object containing:

  • Prerequisite: Conditions that must be met before this step can be executed.
  • Header: A summary of the step's intent.
  • Body: Detailed instructions or code blocks.
  • Linker: The "if-then" logic that points to the next logical step based on the outcome of the current one.
  • Meta Data: Source information for updates and maintenance.

The THREAD pipeline involves two main stages:

  1. Reformulate and Refine: Using an LLM to transform unstructured documents (like messy troubleshooting guides) into structured formats.
  2. Extract and Merge: Converting these structures into LUs and merging similar steps across documents to reduce redundancy.

When a user asks a "how-to" question, the system retrieves the first relevant LU. After the step is executed (either by a human or an automated tool), the Linker uses the feedback to dynamically retrieve the next logical unit, creating a continuous "thread" of reasoning.

Key Insights

  • Granularity is a Logic Problem, Not a Length Problem: Traditional RAG debates whether chunks should be sentences or paragraphs. THREAD argues that granularity should follow the logic of the task. One LU might be a single sentence, while another is a complex code block, depending entirely on what constitutes a discrete "step."
  • The "Linker" as a Dynamic Edge: Unlike a static Knowledge Graph, the Linker in an LU allows the RAG system to handle branching logic. It essentially turns a static document into a navigable decision tree.
  • Efficiency through Precision: Because LUs are highly targeted, the system retrieves much smaller, more relevant units. This reduces the "noise" fed into the LLM, leading to fewer hallucinations and lower token costs.

Key Results

The researchers evaluated THREAD across diverse scenarios, including web navigation (Mind2Web), linear instructions (WikiHow), and real-world industrial troubleshooting (Incident Mitigation, or IcM).

Performance comparison showing THREAD significantly outperforming traditional chunk-based methods across F1, Exact Match (EM), and Accuracy metrics.
  • Superior Success Rates: In the industrial Incident Mitigation (IcM) scenario, THREAD improved the success rate of resolving cloud service incidents by 21.05% to 33.33% compared to chunk-based baselines.
  • Massive Efficiency Gains: THREAD reduced the number of tokens required for generation by up to 75% compared to traditional chunking. In the Mind2Web tests, THREAD used an average of 157 tokens per retrieval unit, whereas document-based RAG used 663.
  • Robustness Over GraphRAG: THREAD outperformed other advanced paradigms like GraphRAG on how-to questions. While GraphRAG focuses on entity relationships, THREAD’s focus on procedural logic proved far more effective for step-by-step tasks.
  • Generalization: Even on standard multi-hop factoid questions (2WikiMultiHopQA), THREAD significantly outperformed chunk-based RAG, proving that logical linking is useful beyond just "how-to" guides.

Limitations and Future Work

Converting an entire knowledge base into Logic Units requires an initial investment in LLM API calls for reformulation and extraction. However, the authors note this is a one-time cost that pays off in significantly lower inference costs later.

Moving forward, the authors suggest that while THREAD is superior for procedural knowledge, it should ideally coexist with chunk-based systems in a hybrid architecture to handle a diverse mix of factoid and "how-to" queries. Future work will also involve extending THREAD to more diverse, open-domain tasks to evaluate how well the "Logic Unit" concept scales to less structured information.

Summary updated

BibTeX
@misc{an2024thread,
  author = {Kaikai An and Fangkai Yang and Liqun Li and Junting Lu and Sitao Cheng and Shuzheng Si and Lu Wang and Pu Zhao and Lele Cao and Qingwei Lin and Saravan Rajmohan and Dongmei Zhang and Qi Zhang and Baobao Chang},
  title = {{Thread: A Logic-Based Data Organization Paradigm for How-To Question Answering with Retrieval Augmented Generation}},
  year = {2024},
  eprint = {2406.13372},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.13372},
}
Figure