Domain Knowledge Compression: A Context Strategy for AI Scientists

    This article examines why on-demand retrieval falls short for AI research agents and how domain knowledge compression addresses that gap. It outlines a five-layer pipeline—extract, cluster, align, compress, and compose—that turns large volumes of top-tier conference papers into a reusable, traceable, model-agnostic knowledge base that fits into a context window. The article also covers how agents can consume this knowledge through a map-then-drill approach, which metrics to use for evaluation, common pitfalls to avoid, and a general implementation path on Baidu AI Cloud. Readers will gain a practical, verifiable route for moving from a program that runs experiments to a researcher that understands a domain before experimentation begins.

    1. A Warning Sign: Knowledge Has Outgrown the “Readable” Boundary

    One of the most discussed topics in technical communities recently is the scale of a formal proof: roughly 17 million lines of code across more than 100,000 files. Shortly afterward, researchers used automated methods to compress it to about 76,000 lines—a compression rate above 99%—while preserving the core argumentation chain and producing a readable natural-language summary. Only then did the community truly begin to “read” it.

    The technical significance here is not any specific result, but a general rule: knowledge that has not been compressed is knowledge that has not yet been understood. The original artifact is verifiable by machines but unreadable to both humans and models. The context window is a finite resource, and any information that exceeds it effectively does not exist during inference.

    For an AI Scientist, this rule is even more decisive. Today’s agents can retrieve literature, propose hypotheses, write code, and run experiments. Yet most workflows still rely on “just-in-time retrieval”: pulling the abstracts and methods of a few dozen papers, assembling a context, and starting to brainstorm. What the agent sees is a few dozen slices of a field, not the structure of that field.

    2. Why On-Demand Retrieval Cannot Support Research Topic Selection

    On-demand retrieval has three structural flaws:

    • Coverage bias: Retrieval is constrained by query terms. Popular directions are recalled repeatedly, while interdisciplinary areas and negative results are systematically ignored.
    • Lack of hierarchy: Abstracts sit on a flat plane with no “problem–method–evidence–limitation” layering, making it hard for the model to judge what has been solved and what remains a gap.
    • Not reusable: Every task repeats retrieval and reading, incurring high token costs and yielding unstable conclusions. The same question may produce different judgments across two runs.

    The key point: experiments can be rerun and code can be rewritten, but a wrong topic choice ruins everything. The bottleneck in agent capability is therefore not on the execution side, but on whether the agent truly understands the field before entering the experiment.

    3. Target Form: A Domain Knowledge Base That Fits in Context

    To solve these problems, the goal is to compress hundreds of thousands of accepted papers from top-tier conferences over the past decade into domain knowledge that both humans and models can “fit in their heads.” Its target properties can be summarized in five points:

    1. Highly condensed: Express the backbone of a field within a limited token budget, rather than piling up literature.
    2. Traceable: Every conclusion can point back to a specific evidence source, enabling verification and accountability.
    3. Model-agnostic: Delivered as plain text and structured data that any model can plug into directly.
    4. Reusable: Built once and shared across multiple tasks, avoiding repeated retrieval overhead.
    5. Evolvable: New papers are continuously incorporated, with versions that can be compared and rolled back.

    4. Build Process: A Five-Layer Compression Pipeline

    It is advisable to split the build into five layers, each doing one thing, to make quality attribution easier.

    Layer 1: Extract
    For each paper, extract structured fields: research question, core hypothesis, method family, datasets and evaluation criteria, main conclusions, and author-stated limitations. This layer makes no judgments; it only normalizes.

    Layer 2: Cluster
    Cluster along the two dimensions of “problem–method” to form topic clusters. Within each cluster, distinguish mainstream routes, peripheral routes, and refuted routes, so that negative results are not mistaken for gaps.

    Layer 3: Align
    Bind conclusions to evidence and record differences in evaluation settings. Conclusions lacking comparable criteria must be explicitly marked as “not directly comparable”—a critical step for preventing the model from making erroneous causal inferences.

    Layer 4: Compress
    For each topic cluster, generate layered summaries: a one-sentence conclusion, a paragraph of method overview, a route-evolution table, and a set of open questions. The compression target is information density, not word count.

    Layer 5: Compose
    Organize content into a four-level structure—domain map, topic clusters, evidence cards, and open questions—forming a context that can be injected as a whole and also loaded on demand by cluster.

    An illustrative data structure (expressing organization only, not a specific interface):

    1. {
    2. "domain": "representation_learning",
    3. "version": "2025.11",
    4. "clusters": [
    5. {
    6. "id": "c-017",
    7. "question": "How to improve generalization under low annotation",
    8. "routes": [
    9. {"type": "mainstream", "assumption": "...", "evidence": ["e-1a","e-1b"]},
    10. {"type": "refuted", "assumption": "...", "evidence": ["e-2c"]}
    11. ],
    12. "open_questions": ["lack of cross-criteria comparability", "insufficient evaluation in long-tail scenarios"]
    13. }
    14. ],
    15. "evidence": {
    16. "e-1a": {"metric": "acc", "setting": "A/B", "comparable_with": ["e-1b"], "source_ref": "paper#id/section"}
    17. }
    18. }

    5. How Agents Consume This Knowledge

    A two-stage “map first, then drill down” usage is recommended, rather than stuffing the context all at once:

    1. # Step 1: Load the domain map (low token) and locate candidate questions
    2. map = load_domain_map("representation_learning")
    3. candidates = rank_open_questions(map, constraints={"compute": "low", "data": "public"})
    4. # Step 2: Drill into evidence cards only for candidate clusters
    5. ctx = load_cluster(candidates[0].cluster_id, include="evidence+limits")
    6. hypothesis = propose(ctx) # output must cite evidence id

    Three engineering constraints significantly improve reliability: hypotheses must carry evidence references; cross-criteria conclusions must be marked as not comparable; refuted routes are excluded by default unless counterexample exploration is explicitly requested.

    6. Evaluation: Don’t Just Look at “Does It Look Like a Paper”

    Four categories of metrics are recommended, with controlled experiments as the standard:

    • Coverage: The domain map’s coverage of a known survey topic tree.
    • Traceability: The proportion of conclusions that correctly point back to evidence.
    • Topic quality: The proportion of agent-proposed hypotheses that yield positive results in subsequent experiments, A/B tested against an on-demand retrieval baseline.
    • Cost efficiency: The tokens and number of retrievals consumed to reach the same topic quality.

    It is worth emphasizing that any compression loses information. The evaluation focus is not “losslessness” but the retention rate of task-relevant information. Compression strategies should therefore be iterated based on downstream task feedback.

    7. Implementation: A General Path on Baidu AI Cloud

    To carry this pipeline in production, a combination of general cloud capabilities can be used, avoiding binding to specific products: object storage holds raw literature and versioned knowledge snapshots; a message queue decouples extraction and clustering tasks; a container platform hosts elastically scalable parsing and embedding jobs; logging and monitoring with alerting track compression failure rates and drift; a data-warehouse service stores evidence cards and supports topic-based traceback. Permissions and auditing are controlled through unified identity and access management, ensuring that “traceability” is not just a data field but an auditable chain.

    8. Common Pitfalls

    • Treating abstract stacking as compression: Without hierarchy and evidence binding, it just makes noise shorter.
    • Ignoring evaluation criteria: Placing numbers from different settings side by side leads the model to wrong conclusions.
    • Injecting everything at once: The token budget is squeezed by map-level information, degrading drill-down quality.
    • No version management: Domain understanding shifts as new papers arrive; without versions, historical conclusions cannot be reproduced.

    Conclusion

    From 17 million lines to 76,000, the real change is not length but the understandability that readability brings. The next stage of competition for AI Scientists will not be about who can run more experiments, but about who possesses structured domain awareness before experiments begin. Compressing massive literature into a reusable, traceable, model-agnostic knowledge base is the first step in advancing a “program that can run experiments” into a “researcher that understands a domain”—and the most pragmatic, verifiable path in engineering today.