K-COMP: Retrieval-Augmented Medical Domain Question Answering With Knowledge-Injected Compressor
Paper · 2025 · Jeonghun Cho and Gary Lee
Summary
A medical search can retrieve passages on the right subject and still leave the reader with a difficult job. The useful evidence may be buried among background details, and a passage can assume that the reader already understands the terms in the question. K-COMP adds a step between search and question answering. It identifies terms in the question, generates brief descriptions of them, and uses those descriptions to guide a summary of the retrieved passages. The system that writes the answer receives the original question, the resulting summary, and the descriptions. The paper studies this arrangement as a form of retrieval-augmented generation.
The compressor learns to produce the descriptions before it writes the summary. During training, the authors cover recognized terms in the question with special markers and put the retrieved passages after that question. The compressor generates the missing terms with their descriptions, then writes a summary while those outputs are still in its context. The training targets come from different sources. The medical collection supplies short descriptions through title matches, while GPT-4o-mini creates example summaries from passages and entity names. At test time, the compressor generates its own descriptions, so the process can work on questions whose terms lack a matching description in the collection.
The authors test the approach on MedQuAD, MASH-QA, and BioASQ with general-purpose and medically trained answer readers. K-COMP improves many comparisons with uncompressed retrieval and with other compressors, although the ranking depends on the reader and the scoring method. On MedQuAD with Llama-3-8B, its BertScore is 83.79, compared with 76.20 for the top-5 passages and 74.27 for a summarization-only version trained from the same starting point. Removing the descriptions from the answer prompt while retaining K-COMP’s summary also reduces both scores in that setting. In a MASH-QA runtime test, K-COMP takes less total time than the top-5 setup even after its compression step is included. The top-1 setup has the shortest measured time.
A separate experiment asks GPT-4o to choose the most useful supporting text for MEDIQA questions, which were outside the compressor’s training datasets. K-COMP remains competitive, with the strongest results against compressors that shorten text independently of the question. The study measures agreement with benchmark answers and preferences among summaries. Expert assessment of the generated descriptions and clinical validation remain outside the experiments.
Deep dive: K-COMP: Retrieval-Augmented Medical Domain Question Answering With Knowledge-Injected Compressor
K-COMP compresses retrieved medical passages around terms in a question, improving many benchmark answers while shortening the reader’s input. · about 35 minutes to read
The problem and its context
Why finding a related passage is only part of the job
The starting point is a familiar division of labor. A retriever looks through a collection and finds text resembling a question. A reader receives that text along with the question and writes an answer. This gives the reader access to information it might otherwise have to recall on its own. Medical questions make the division attractive because the sources can hold specialist information, while the same reader can answer a range of questions without being trained afresh for every collection. The paper treats search as a distinct stage whose success depends on how the retrieved material will be used. Information retrieval and search
A high retrieval score describes a relationship between a question and a passage. It does not identify the part of that passage that supplies the answer, or establish that every statement in it is helpful. A passage about a disease might devote most of its space to how it develops when the question asks about a diagnostic test. Another might name the test in passing without giving its role. Both can be sensible search hits. After several such hits are assembled, the reader still has to find the connection the question asks it to explain.
Specialist terminology adds a separate difficulty. An answer can depend on understanding what a term denotes before deciding how to use the surrounding evidence. The authors cite work on conflicts between retrieved text and information the reader can recall. Their concern is that familiar information may carry more weight for the reader than unfamiliar evidence in the prompt. In a medical task, the unfamiliar information may be exactly what the retrieval step was meant to supply. A broader passage about the topic can make this problem harder if the reader finds familiar background there and builds the answer around it.
The paper connects these issues to hallucination, where a generated answer can sound plausible while giving false or unsupported information. It also distinguishes the amount of text supplied from the accessibility of the useful information within it. Earlier work cited by the authors found that material in the middle of a long prompt could be harder to use. Passage order and prompt design therefore matter alongside retrieval quality. The same evidence can be easier or harder to act on depending on what surrounds it and where the reader encounters it. Survey of Hallucination in Natural Language Generation and Lost in the Middle
Retrieval also depends on what collection exists in the first place. The authors point to open-domain work that used Wikipedia and describe a less settled situation in specialized domains. Finding a broad source of medical text is one part of the problem. The sources also have to cover the language people use to ask questions and the details specialists use to answer them. The paper selects a collection that includes general and biomedical material and gives it a second job during training. Alongside supplying passages for questions, it supplies example term descriptions. Dense Passage Retrieval for Open-Domain Question Answering
What prompt compression had already tried
Earlier approaches in the paper’s account intervene between retrieval and answering. Given a long prompt, a compressor can remove material or write a shorter passage. The first operation retains tokens from the source. The second can combine and rephrase material into sentences suited to the reader’s next task. Both reduce input length. They differ in what they are capable of preserving and in what kinds of mistakes they can introduce.
The authors describe LLMLingua as allocating its compression budget unevenly across prompt components. Their implementation uses it to shorten passages independently of the question. This gives a useful point of comparison. A part of a paragraph can look expendable when considered on its own, even though it supplies the qualifier that answers a particular question. The system has to decide which material is locally informative, while the reader needs material that is informative for a specific purpose. Those judgments can coincide, but the objectives give them different criteria.
RECOMP brings the downstream question-answering task into the selection of useful context. As the paper describes it, RECOMP can supply a summary selected for end-task performance and can omit augmentation when the summary offers little value. Other work the authors cite tries to discard irrelevant evidence while extracting useful material, or learns to generate supporting text from a reward obtained through a reader treated as a black box. The latter setup makes it possible to train a compressor using feedback from the reader’s behavior without access to the reader’s internals.
K-COMP makes the medical terms in a question the focus of compression. The authors distinguish the topic of a passage from the part of that topic a particular question invokes. A question mentioning an imaging technique alongside a disease directs attention to their relationship, while a general summary of the disease can cover many facts without explaining that relationship. Writing useful background can also require defining a term whose meaning the retrieved passages assume. The proposed compressor handles the two jobs in sequence, generating descriptions and then using the resulting text as context for passage compression.
Why the paper uses blanks in the question
The other line of earlier work is text infilling, which trains a system to reconstruct missing content. The paper discusses BERT and SpanBERT as examples of training with masked text, and also discusses T5 and BART in this context. The appeal of masking is that what comes after a blank can explain as much as what comes before it. The paper draws a distinction between reconstructing short spans and generating an extended explanation. Its compressor needs to recover a term and then produce a description whose length depends on the term.
A system that generates from left to right ordinarily predicts each new token using the sequence up to that point. The causal masking work that inspires K-COMP makes a gap available to such a system by placing the material to be generated after the surrounding text. Thus a passage can sit after the blank in its original position and still be available before the system begins filling the blank. The paper also discusses GLM and related decoder-based infilling approaches that can produce spans of variable length.
K-COMP applies this arrangement to a question and its search results. The blank is where a recognized term occurred. The rest of the question shows how that term was used, and the passages can supply evidence about which term belongs there. In the generated output, a description immediately follows the recovered term. The sequence can then continue into a summary. In effect, the training example puts the knowledge the authors want the compressor to articulate directly before the point where they want that knowledge to guide its choice of passage content.
The method, step by step
Retrieve with the original question
K-COMP begins with MedCorp, a collection assembled from Wikipedia, PubMed, StatPearls, and medical textbooks. The selection gives the retriever access to text written for different purposes. Some items can provide short introductory descriptions, while others can contain much more specialized detail. K-COMP uses that range both for finding relevant passages and for constructing the supervision needed to train the compressor.
The retriever uses Nomic Embed to represent text as vectors. In embedding-based nearest-neighbor search, the system compares the question’s vector with passage vectors and returns nearby passages. Nearness is the search system’s way of ranking textual similarity. The result is a set of candidates for the next stage. The procedure does not require the retriever to prove that a passage contains the answer, and the experiments deliberately keep that uncertainty in the pipeline. Semantic similarity and Billion-scale similarity search with GPUs
Search uses the original question. This matters because the next stage covers terms that are useful search cues. If a question names a condition and a procedure, the retrieved passages can contain those names even though the compressor’s copy of the question contains markers in their place. The passages can therefore help with the infilling task. The paper uses five passages to make each training summary, and the training formulation presents the same number as the compressor’s retrieval input.
Identify what the compressor will describe
The authors use SciSpaCy for biomedical named-entity recognition. An entity in this setup is a span of question text that the recognizer marks for processing. The term can be a name, such as a syndrome, or a more general expression with a role in the question. What matters operationally is that the recognizer selects the span. During training, its selection determines which words are covered and which descriptions the authors need to find.
The paper’s simple example asks about the symptoms associated with Down syndrome. The masked version has a marker for the part referring to symptoms and another for the syndrome. The surrounding question still expresses a relationship between the missing terms. The compressor learns to restore the terms into its output and to describe each of them. The example makes the division of labor visible without requiring a medical explanation of the syndrome.
To construct a description target, the paper treats a corpus entry as a title followed by text. The opening sentence is taken as a short description of the title. If a recognized term matches a title, the corresponding opening sentence supplies its description. This makes it possible to build examples from a collection that already exists. It also fixes what the training target means. A description is a brief piece of text tied to a matched entry under the authors’ rule. Its selection follows the corpus structure, instead of a separate assessment of which definition is most useful for the particular question.
Description lookup and passage retrieval serve different purposes. The former requires a title match and yields text used as supervision. The latter ranks passages by similarity to the full question. A useful passage can come from an entry with a different title, and the source of a description need not be among the passages supplied for the same question. Keeping these roles distinct helps explain what happens at inference. The search stage still fetches evidence, while a successful lookup for a definition is no longer a precondition for writing the entity-description output.
Training and development examples have to satisfy the requirements of the supervised task. The authors filter questions without a detected entity and questions for which the required description match is unavailable. Test filtering only removes questions with no detected entities. This gives the compressor a chance to encounter an entity in a test question whose description could not be supplied by the annotation rule. Such a case still depends on recognition, even though the system can proceed without looking up a definition.
Teach the compressor what a summary should contain
The summary target is prepared separately. For each training example, GPT-4o-mini receives the retrieved passages and the recognized entity names. It is asked to write a short account of material concerning those entities. The sample instruction limits the result to fewer than four sentences. The text of the question is withheld at this stage so that the target favors entity-centered evidence over a ready-made answer. The retrieved passages were chosen for the original question, so some influence of the question already enters through search.
The difference can be seen in the paper’s training example about research and clinical trials for Aicardi-Goutières syndrome. The summary generator has retrieved material on the condition, along with an entity list that includes research and clinical trials. The task is to condense material touching these concepts. The RECOMP target shown for comparison receives the full question and is asked for a compact summary usable in answering it. These prompts define different supervision for otherwise related compressor tasks. An answer-oriented target can favor a conclusion specific to the phrasing of the question. An entity-oriented target can retain information about a term that remains useful in other questions.
The entity descriptions and the summary likewise carry different information. A description can state what type of thing a name refers to. A summary can explain what the retrieved passages say about that thing in the context of the question. Knowing that an expression denotes a procedure is a different kind of help from seeing what the passages say the procedure is used to examine. K-COMP gives the compressor training targets for both forms of text and makes the order of generation part of its design.
Making these targets also introduces two different sources of judgment. The title and opening sentence govern description supervision. GPT-4o-mini decides what to retain and how to express it when constructing the summary. The reference answers used for scoring the final reader are separate from these targets. This distinction is central to the experiment. The compressor is taught to supply material for answering, and another system subsequently decides what answer to give.
How K-COMP prepares an answer prompt
The steps in order.
Put the output in causal order
The authors fine-tune Gemma-2B, using its existing left-to-right generation architecture. Here, fine-tuning means updating the starting system on examples of the new task. The change of behavior comes from the input and target sequences and the training objective. The authors keep the architecture and teach it an output order in which the recovered entities and their descriptions precede the summary. Gemma
The compressor starts from the tokenized question. A token is an element of the sequence the system processes, so an entity span can consist of several tokens. The paper writes the original question as follows. Tokenization
q = [q₁, q₂, …, qₙ]
Here q is the question, q₁ and q₂ are its opening tokens, and qₙ is its last token. The subscript n represents the question length, denoted by N in the paper. The brackets enclose the ordered sequence, and the ellipsis stands for the intervening tokens.
The corresponding masked question replaces each selected span with the same special marker.
qₘ = [q₁, …, <ent>, …, qₙ₋ₗ]
Here qₘ is the masked question, with m indicating masking. The symbol <ent> is a literal special token representing a covered entity span. The ellipses allow for retained question tokens and any additional markers. The subscript n−l indicates the final position after the substitutions, with l accounting for the change in token count. The expression displays the form of the sequence. The position and number of markers depend on the recognized spans.
The retrieved passage collection is written as follows.
P = {p₁, p₂, …, p₅}
Here P is the collection returned for the question, p₁ and p₂ denote its opening passages, and p₅ denotes its final passage in the training setup. The ellipsis covers the intervening entries. Braces collect the passages. When the passages are put into an input sequence, the compressor sees them after the masked question.
The description target has an explicit stopping marker.
dᵢ = [dᵢ¹, …, dᵢᴹ, <eod>]
Here dᵢ is the description of the entity indexed by i. The superscripts index tokens inside that description. The ordinary description starts at dᵢ¹ and ends at dᵢᴹ, where M is its length before the special marker. The brackets give the order, and the ellipsis represents the remaining description tokens. The literal <eod> marks the end of a description. In the paper’s example, the name of the entity introduces the definition that ends with this marker.
A compressor training example brings the passage input, summary target, entity set, and description set together.
(qₘ ⊕ P, S, E, D)
Here qₘ is the masked question, P is its retrieved passage collection, and ⊕ means to concatenate them in that order. S is the gold summary prepared for the example. E is the collection of recognized entity strings, with eᵢ denoting the string at entity position i. D is the collection of corresponding descriptions dᵢ. The tuple describes the parts of an example. Generation places the entities and descriptions before the summary even though the tuple lists the summary target earlier.
This positioning explains how the compressor uses information on both sides of a blank while generating causally. The part of the question before the blank, the part after it, and the retrieved passages are already in the input when output generation begins. The system can attend to all of them. The left-to-right restriction applies to the generated sequence. When the compressor starts a description, it has already generated the entity name. When it starts the summary, it has already written the descriptions. The output develops in one direction while taking account of text that originally surrounded each blank.
What the objective asks it to predict
The paper writes the entity-description objective as a product over entities and over positions within their outputs. Using subscripts for the entity index and for token positions, its schematic factorization is:
Pθ(E, D | qₘ ⊕ P) = ∏ᵢ ∏α,β Pθ(eᵢ,α, dᵢ,β | eᵢ,<α, dᵢ,<β, qₘ ⊕ P)
Here Pθ denotes the compressor’s probability assignment, with θ standing for its trainable parameters. The standalone P on either side of the equation denotes the retrieved passages. E and D are the entity and description collections, qₘ is the masked question, and ⊕ joins the question and passages. The vertical bar means “conditioned on.” The outer product ∏ᵢ runs over entity index i. The inner product ∏α,β uses α for a token position in the entity string and β for a token position in its description. Thus eᵢ,α and dᵢ,β are the tokens at those positions, and eᵢ,<α and dᵢ,<β denote the earlier tokens in those parts of the output.
The expression summarizes the dependencies the authors want to learn. At the implementation level, training uses ordinary next-token prediction in a serialized output. An entity can be short while its description is several tokens long, and the equation’s pair of token indices should be read in light of that output order. The description can draw on the entity string that introduces it. The end marker is also part of the text the compressor learns to produce. This lets it end a description at a point appropriate to the example.
The summary follows by the same rule of predicting a token given the tokens already available. The equation for that part is:
Pθ(s | E, D, qₘ ⊕ P) = ∏γ Pθ(sγ | s<γ, E, D, qₘ ⊕ P)
Here s is the summary sequence, represented by the target S in the example tuple. The index γ identifies a summary position, sγ is the token at that position, and s<γ is the summary prefix up to that point. The product ∏γ covers the summary positions. Pθ is the probability under parameters θ. E and D are available as the preceding entity-description text, and qₘ ⊕ P is the original compressor input. The vertical bar introduces the material available when a prediction is made.
The probability of the full target combines the probability of producing the terms and descriptions with the probability of continuing into the summary:
Pθ(E, D, s | qₘ ⊕ P) = Pθ(E, D | qₘ ⊕ P) × Pθ(s | E, D, qₘ ⊕ P)
On the left, E, D, and s are the complete output under parameters θ. On the right, × multiplies the probability of the first part by the probability of the continuation after that part. The vertical bars specify which text each part conditions on. The masked question qₘ and retrieved passages P, joined by ⊕, are available throughout. The summary part additionally conditions on E and D.
The authors minimize the negative log probability of the observed output averaged over training examples:
L(θ) = −𝔼[log Pθ(E, D, s | qₘ ⊕ P)]
L is the loss as a function of θ. The expectation symbol 𝔼 averages over training examples and is distinct from E, the entity collection. The logarithm acts on the probability assigned to the full target given qₘ ⊕ P, and the minus sign makes higher target probability correspond to lower loss. D and s are the description and summary targets. This is next-token cross-entropy on the assembled output. The training signal for the medical knowledge comes from which tokens the examples ask the compressor to predict and when they ask it to predict them.
K-COMP and the summarization-only FineTune comparison start from Gemma-2B and share the training hyper-parameters. The authors select checkpoints on the development set. They use a cosine learning-rate schedule, weight decay of 3%, and early stopping based on validation loss. The learning rate is 1e-4 for MedQuAD and MASH-QA and 1e-5 for BioASQ. The point of using the same starting architecture and training settings is to make FineTune a comparison for the proposed output and supervision, alongside comparisons with compressors that differ more substantially.
What the reader gets at inference
For a new question, the retriever supplies passages and the recognizer identifies the terms to cover. The compressor then produces its own terms and descriptions, closing descriptions with <eod> and continuing into the summary. Unlike the description preparation step for training, this stage requires no lookup of a matching title for each recognized term. It can produce a description based on the question, passages, and what it learned in training. The generated descriptions also become part of the input for the compressor’s own summary, so their influence can extend past the lines explicitly labeled as descriptions.
The final reader receives the original question and the compressed material. The sample prompt displays the summary and descriptions in separate sections, which makes it possible to remove the latter for an ablation. The reader is asked to answer in a 0-shot setting, meaning that its prompt contains the problem and context without worked examples of the task. The distinction between training the compressor and prompting the reader makes it possible to examine the same augmentation method with readers of different sizes and backgrounds.
Experiments and results
The datasets and the evaluation population
MedQuAD covers biomedical questions about subjects including diseases, drugs, and diagnostic tests. The authors make an 80/10/10 training, validation, and test split because the dataset comes without the test partition they need. MASH-QA uses consumer health questions whose answers can draw on separate spans in a longer document. That structure makes finding the most pertinent lines of evidence part of the task. BioASQ uses biomedical material from PubMed and provides a setting with more specialist literature. These datasets let the authors examine a common method across different kinds of medical questions and reference answers.
MASH-QA and BioASQ have gold passages, meaning passages associated with the reference answer. The experiments use passages found by the retriever in their place. This makes retrieval errors part of the reader’s operating environment. The training summaries are built from that retrieved material as well. A result therefore reflects the ability of the complete augmentation process to work with the passages it actually obtains. It does not measure a compressor’s ability to preserve a known answer from an ideal input.
Filtering changes the populations used to train and test. For MedQuAD, 13,127 training examples become 9,064, while 1,640 validation examples become 1,095. The MedQuAD test split goes from 1,640 to 1,554. The smaller change at test time follows from the narrower requirement there. MASH-QA goes from 27,728 to 20,458 training examples and from 3,493 to 3,226 test examples. BioASQ goes from 3,209 to 2,284 training examples and from 707 to 647 test examples. These denominators matter. The main results apply to questions that pass the test-time recognition filter, and the compressor learns from a training population with the additional corpus-match requirement.
MEDIQA plays a different role from the main benchmarks. The authors use the question-answering part of that collection for a transfer evaluation of the compressed context. They test 140 questions with compressors trained on the other datasets. This lets them see whether a preference for K-COMP summaries carries over to another collection of medical questions. The outcome of that exercise is a judgment about prompt material, distinct from the main experiments’ scores on finished answers.
What changes across systems and what gets scored
The control conditions called Top-1 and Top-5 give the reader the highest-ranked passage or the top-ranked group in raw form. Comparing them tests whether the extra passages improve the prompt as they stand. The other settings first process the passage set. RECOMP is implemented as an abstractive compressor trained on the authors’ datasets, meaning it writes a fresh summary. LLMLingua uses Llama-2-7B to shorten input text and supplies a token-level compression comparison. FineTune uses the same Gemma-2B starting point as K-COMP and learns ordinary summarization, allowing a closer comparison with the full entity-description procedure. Llama 2
The general-purpose readers are Llama-3-8B, Llama-3-70B, Mixtral-8x7B, and GPT-4o. The medically trained readers are MedAlpaca-13B and Meditron-70B. Variation among readers is part of the experimental design. A summary may supply information one reader needs while duplicating information another can already use. A prompt that fits one reader’s context window can strain another’s. The authors implement the open systems with Hugging Face’s software and use AWQ versions of several larger systems to fit available hardware. Transformers and GPT-4o System Card
The main datasets have long-form answers, so the study evaluates generated text against reference answers. BertScore uses contextual representations to measure similarity. It can give credit where related wording serves a similar role in the candidate and reference. The authors use UniEval for factual consistency with the reference answer. These measures answer related questions, and the paper reports their scores separately. In particular, a BertScore of 83.79 is a score in the article’s reported units. It should be read as a comparison of answer similarity for that dataset and reader, rather than as a count of questions answered correctly.
A distinction runs through the experiments between answering well and producing a useful prompt. The main scores apply to answers produced after the reader sees the augmentation. A later comparative evaluation asks GPT-4o to choose among the augmentations themselves. The runtime experiment records a third outcome. Differences across these evaluations are possible because brevity, the perceived usefulness of a rationale, and the quality of the actual answer are different properties.
The main benchmark results
The clearest gains appear in several configurations with Llama-3-8B. On the MedQuAD test split, K-COMP leads the raw-passage settings and all the reported compressors on BertScore. It also reaches 64.05 UniEval. RECOMP, the strongest alternative compressor there on UniEval, scores 55.74, while LLMLingua scores 54.65 and FineTune scores 54.89. The two metrics agree on the leading setting for this reader and dataset even though the order of the other settings differs.
Retrieval and compression settings on MedQuAD test BertScore with Llama-3-8B
Entity-centered compression leads both raw retrieval and the alternative compressors for this reader.
The numbers
| System or setting | BertScore |
|---|---|
| Top-1 document | 75.65 |
| Top-5 documents | 76.20 |
| RECOMP | 73.27 |
| LLMLingua | 76.45 |
| FineTune | 74.27 |
| K-COMP (this paper) | 83.79 |
The increase recurs for that reader on the other test sets. On MASH-QA, K-COMP records 83.45 BertScore and 61.45 UniEval. RECOMP reaches 80.20 BertScore and 58.80 UniEval on the same split, while the raw top-5 setting gets 77.59 and 52.94. On BioASQ, K-COMP’s scores are 86.61 BertScore and 62.28 UniEval. The raw top-5 setting gets 81.44 and 61.33. This last comparison illustrates the importance of reading both columns. The relative strength of the uncompressed passage group is more apparent on BioASQ’s UniEval result than on its BertScore result.
Llama-3-70B shows cases in which the choice between compressors is closer and the metrics favor different settings. On MedQuAD, K-COMP reaches 82.06 BertScore and 62.91 UniEval. RECOMP earns 79.75 BertScore and 63.57 UniEval, so the two settings split those metrics. On BioASQ, K-COMP scores 87.03 BertScore and 62.89 UniEval for the same reader. FineTune reaches 86.17 BertScore and 62.86 UniEval. Both figures matter when assessing the added entity procedure. A lead in answer similarity can coexist with a consistency result near the comparison system.
Mixtral-8x7B gives another example. On the MedQuAD test set, its BertScore is 64.17 with the top-5 passages, 71.58 with RECOMP, and 80.64 with K-COMP. On MASH-QA, RECOMP reaches 82.12 BertScore against 81.49 for K-COMP. Their UniEval scores on that split are 62.35 and 62.91, respectively. Improvement with a particular reader can depend on the dataset as well as the measure, even when the same augmentation strategies are compared.
With GPT-4o as reader, strong raw-passage results are especially visible. On MedQuAD, K-COMP records 85.49 BertScore and 63.16 UniEval. Supplying the top-5 passages gives 83.08 BertScore and 64.98 UniEval. On BioASQ, FineTune records 87.97 BertScore, compared with 87.77 for K-COMP. The raw top-5 prompt gives GPT-4o a UniEval of 66.15 there, while K-COMP gives it 64.38. These results make the full pattern more informative than a pooled claim about compression. The paper finds an advantage in many configurations and also records readers and measures for which additional raw context remains competitive or leads.
The effect of prompt length is easiest to see with MedAlpaca-13B. The authors report a context window of 2048, the smallest among their readers. On MedQuAD, the BertScore with raw top-5 input is 17.57. The top-1 BertScore is 75.05 and K-COMP reaches 85.75. On MASH-QA, the corresponding BertScores are 31.91 with top-5, 76.95 with top-1, and 81.95 with K-COMP. The authors attribute the sharp decline with the longer prompt to the limited window. This is a comparison in which compressing the input can help the reader take in the material before any benefit from an improved description is considered.
Meditron-70B also benefits from compression in several end-to-end comparisons, though the raw-prompt results follow a different pattern. On BioASQ, K-COMP scores 86.70 BertScore and 62.90 UniEval. The top-5 setting scores 83.63 and 59.52, and FineTune yields 85.05 and 61.20. Such comparisons support the compatibility of K-COMP with multiple readers. The individual reader results also motivate the paper’s separate test of whether the definitions themselves help once the compressed passage is available.
What the timing test establishes
The runtime test uses Llama-3-70B as the reader on the MASH-QA test set. The compressor and reader run on a single NVIDIA A100 with 80GB of memory. The test reports prompt token counts and GPU time. The three conditions represent fetching a short raw input, presenting the larger retrieved set, and converting that set into shorter context before answering.
The reported input lengths are 195 tokens with Top-1, 978 with Top-5, and 198 with K-COMP. Top-5 takes 20,193s. K-COMP uses 9,777s for reader inference and 497s for compression, with a reported total of 10,274s. The Top-1 total is 9,798s. The compressor thus produces input close to the Top-1 length while drawing on the larger passage set. Relative to raw Top-5, the reader saves enough work to cover the added generation stage. For the measured reader and hardware, Top-1 remains the shortest route when timing alone is the criterion.
Total GPU time on the MASH-QA test set with Llama-3-70B
The cost of compression is offset by faster reading relative to the full retrieved set.
The numbers
| System or setting | seconds |
|---|---|
| Top-1 document | 9,798 |
| Top-5 documents | 20,193 |
| K-COMP (this paper) | 10,274 |
The token and timing figures describe that implementation. The price of adding a generation stage depends on the reader, the compressor, and how each is run. The authors expect reader size and input length to influence the tradeoff. The experiment supplies a measured case in which a short generated prompt replaces a much larger raw one and the savings are visible after including both inference stages.
An additional retrieval baseline
The appendix compares K-COMP with RAPTOR, which recursively summarizes text to build a tree. This places some summarization work in the construction of the retrieval structure. The authors use FineTune to produce those summaries. Because building the tree over the full MedCorp collection would exceed their resources, the RAPTOR corpus consists of the top-5 passages returned across the dataset. The authors argue that this selection can favor relevance. The condition remains specific to their implementation of RAPTOR.
In the answer evaluation, K-COMP is ahead on many comparisons, while RAPTOR has several stronger UniEval results. On MedQuAD with Llama-3-8B, RAPTOR records 74.96 BertScore and 60.84 UniEval, compared with 83.79 and 64.05 for K-COMP. With Llama-3-70B on the same test set, RAPTOR has 77.66 BertScore and 71.79 UniEval, while K-COMP has 82.06 and 62.91. The results show that the two approaches can offer different strengths in the particular retrieval setup. A summary preference test provides an additional perspective. GPT-4o chooses K-COMP in 77.9% of the MedQuAD comparisons, RAPTOR in 20.7%, and a tie in 1.4%. On BioASQ, the preference is closer, with 52.5% for K-COMP, 43.4% for RAPTOR, and 4.1% ties.
What the ablations show
Definitions in the reader’s prompt
The cleanest intervention is called −Prior. The compressor runs normally, so it still generates the terms and descriptions and can use them when writing its summary. The authors then remove the entity-description section from the final reader prompt. The reader sees the same summary and question as in K-COMP. A difference in answer score therefore concerns the value of giving the descriptions to the reader directly, given a summary that was already written with access to them.
For Llama-3-8B, the direct handoff makes a substantial difference. On MedQuAD, −Prior obtains 73.93 BertScore and 54.47 UniEval, while the full prompt obtains 83.79 and 64.05. FineTune is near −Prior at 74.27 and 54.89. On MASH-QA, the full K-COMP prompt reaches 83.45 BertScore, while −Prior gets 78.63. On BioASQ, the full prompt reaches 62.28 UniEval and −Prior gets 55.06. The pattern supports a role for the explicit descriptions, with the result on each split measured using the same reader.
Effect of including entity descriptions on MedQuAD test UniEval with Llama-3-8B
The reader scores highest when it receives the descriptions alongside the summary.
The numbers
| System or setting | UniEval |
|---|---|
| FineTune | 54.89 |
| K-COMP summary only | 54.47 |
| K-COMP (this paper) | 64.05 |
The effect is smaller or reverses in parts of the comparison with medically trained readers. On MedQuAD with Meditron-70B, −Prior reaches 79.80 BertScore and 59.00 UniEval, while the full prompt gives 78.88 and 58.95. On MASH-QA with MedAlpaca-13B, −Prior reaches 82.18 BertScore and 52.02 UniEval, compared with 81.95 and 51.76 for the full prompt. The same MedAlpaca reader benefits from the descriptions on BioASQ by BertScore, where the full prompt reaches 84.88 and −Prior gets 84.53. Its BioASQ UniEval ranking goes the other way, with 45.47 for the full prompt and 46.67 for −Prior.
The authors interpret some of these results as evidence that a medical reader may already know the terminology or find the additional description distracting when it conflicts with what it has learned. The ablation measures how answers change after a prompt intervention. It cannot identify the reader’s reason for changing its answer. That distinction matters most in examples where adding the definitions moves one metric upward and the other downward. The observations support variation in how useful the descriptions are, while the account in terms of knowledge conflict remains an interpretation.
Comparing −Prior with FineTune addresses a neighboring question. The two conditions give the reader a summary without a separate description section, but the summaries come from different training procedures. With MedAlpaca-13B on MASH-QA, −Prior reaches 82.18 BertScore and FineTune reaches 79.96. With Llama-3-8B on BioASQ, −Prior earns 80.75 BertScore and FineTune earns 82.26. A summary produced after generating descriptions can help even when they are withheld from the reader, and the results also include conditions where ordinary summarization does better. This comparison changes both the summary supervision and the compressor’s preceding generation task, so it measures their combined effect.
Does the compressed text look more relevant?
The paper tests relevance with BAAI/bge-reranker-large, which receives a question and a collection of candidate contexts and ranks the candidates by how well they match. For each question, K-COMP generates 10 candidate contexts at temperature 1. A higher temperature allows more variation in generation, so this exercise tests a pool of possible summaries. The authors add the top-10 raw retrieved passages, making a pool of 20 candidates for each question.
The reported Recall@1 values describe which kind of text wins the top position in that mixed pool. Compressed candidates receive 77% on MedQuAD, 73% on MASH-QA, and 83% on BioASQ. The reported raw-passage shares are 23%, 27%, and 17%, respectively. This use of Recall@1 concerns preference for the compressed candidates. The study does not use a gold answer passage to define successful recall in this analysis. The term therefore has a specific operational meaning here. A high score indicates a preference by the ranking system, with no direct statement about whether every claim in the chosen context is accurate.
The reranking experiment and the −Prior experiment examine different places in the pipeline. A reranker can favor text that brings the requested entity and relation closer together. The reader might then use that text differently depending on how much supplemental explanation it needs. Even a context that receives the top relevance rank can lead to a poor answer if the description or the summary is wrong. In the other direction, a capable reader may answer well from a broad summary containing some useful evidence. The paper’s rheumatoid arthritis example illustrates this range of behavior.
What an example reveals about focusing the summary
The case study asks about the role of X-rays in diagnosing rheumatoid arthritis. In the FineTune condition, the summary gives a broad account of the disease and includes several imaging techniques. In the K-COMP condition, the output explicitly describes the named procedure and condition, and the summary devotes more space to what the passages say about X-rays. The contrast concerns focus. Both summaries can mention imaging, while one more consistently organizes its statements around the particular technique asked about.
With Llama-3-8B, the FineTune answer is brief and mentions signs of joint damage. The K-COMP answer goes into more detail and discusses findings and their variation as the condition progresses. The extended comparison also shows that the larger Llama-3-70B can give a fairly developed answer from the broader FineTune summary. That matters for interpreting the difference. The example displays how the same method can supply conspicuous extra guidance to one reader while another already produces a detailed response. The case study shows what the outputs contain. It provides no expert adjudication of their individual medical claims.
Judging the summaries and testing transfer
In a separate study, the authors ask GPT-4o to choose the best supporting summary given a question. The judge considers relevance, informativeness, and apparent biomedical expertise. It selects a candidate or declares a tie. The authors randomize candidate order to reduce position effects. The query-agnostic comparison includes Selective-Context, LLMLingua, and a GPT-4o-mini summary written without the question. The query-based comparison includes SPLADE, RECOMP, and a GPT-4o-mini summary written with the question.
These baselines help interpret what the judge favors. Selective-Context and LLMLingua shorten input at the token level. The samples in the paper show that this can yield fragments, although retained terms can still register as meaningful overlap in an automatic score. SPLADE selects a passage from the retrieved group by reweighting important terms associated with the query. RECOMP and query-based GPT-4o-mini can write complete sentences with the question as guidance. Thus the query-based comparison includes candidates that can offer coherent and directly targeted supporting text, as well as an extractive approach.
On the MedQuAD test split, the judge selects K-COMP 1,290 times in the query-agnostic comparison and GPT-4o-mini 259 times. In the query-based comparison on the same split, it selects K-COMP 710 times and GPT-4o-mini 504 times. The other datasets show a closer contest when the alternative also receives the question. On MASH-QA the query-based GPT-4o-mini summary is selected 1,240 times and K-COMP 1,208 times. On BioASQ the counts are 253 and 242, respectively. These are choices among candidates under the stated prompt, so they establish relative preferences within a particular comparison rather than an absolute level of summary quality.
On MEDIQA, the version trained on MedQuAD receives 115 choices in the query-agnostic evaluation and 62 in the query-based evaluation. For the version trained on MASH-QA, the corresponding results are 121 and 64. In the latter query-based comparison, GPT-4o-mini receives 51 choices. The version trained on BioASQ receives 91 in the query-agnostic comparison and 46 in the query-based one, where GPT-4o-mini receives 71. The transfer result is strongest against the question-independent alternatives. The dependency on the training dataset and the strength of the query-based competitor give a more specific account of where it transfers.
The authors’ explanation is that medical terminology is shared across collections even when question distributions differ. An entity-oriented summary can carry useful material across that change. The experiment supports this interpretation through summary preferences on MEDIQA. It leaves open how much those preferred summaries would improve final reference-answer scores on that dataset.
Checking the answer scores with another evaluator
The authors also use G-Eval as a supplementary assessment of finished answers. The judging prompt gives the question, a passage, the generated answer, and a reference answer. It asks for a coherence score on a 1-5 scale, interpreting coherence to include logical structure, relevance, and agreement with the reference. The paper reports averaging 20 samples from GPT-4 and says it uses random selections of 1k data points per dataset to manage evaluation cost.
Several settings agree with the broad UniEval pattern. On MedQuAD with Llama-3-8B, K-COMP receives 3.55 on G-Eval-4 and FineTune receives 3.28. With Llama-3-70B on the same dataset, RECOMP reaches 3.80 and K-COMP earns 3.66, matching the preference between those two settings in UniEval. When GPT-4o is the reader on MedQuAD, the raw top-5 condition receives 4.73 and K-COMP gets 4.48. The additional evaluator thus supports some of the favorable findings and some of the exceptions. Agreement between these automatic evaluations gives evidence about the stability of a comparison under different scoring prompts and systems.
Limitations
Limits identified by the authors
The first limitation starts before generation. A question needs detectable terms for K-COMP to make the kind of prompt it was trained to make. The authors point to ambiguous expressions a recognizer may miss and concepts that are implied without appearing in the question. A passage might mention an important concept that the question leaves unstated, but the described masking procedure chooses blanks from spans already present in the question. The ability to write a description without a title match solves a later problem in the pipeline. Coverage of the earlier recognition step is still restricted.
The authors discuss expanding the medical collection as one potential way to make more knowledge available. A larger corpus could supply additional entities and useful passages. It would also add work to annotation and similarity search. K-COMP’s corpus has two roles, so expansion has different consequences for each. Extra material can improve the evidence available for retrieving answers, while better coverage of short title descriptions can increase the portion of questions usable for training. Simply adding material cannot guarantee either consequence, particularly for terms that remain hard to detect.
The study focuses on English biomedical questions. The authors describe data availability as an obstacle in other specialized domains and in other languages. Transferring the procedure would require question data, suitable retrieval material, and a way to recognize and describe terms. Those resources can have different levels of coverage from the ones used here. The MEDIQA experiment changes the benchmark within medical QA and offers evidence about that kind of transfer. Evidence for extension to other languages and professional domains remains open.
The authors also state that the work is at an early research stage and unsuitable for direct practical medical use. The experiments use publicly available benchmark data, and the paper says personally identifiable information was excluded when synthesizing summary targets. The clinical concern the authors emphasize is reliability. A plausible false claim can have serious consequences for care or medical decisions. A benchmark result based on automatic comparison with reference answers leaves clinical usefulness and safety unmeasured.
Limits of what the comparisons can establish
The recognition filter narrows the test questions before scoring. On the BioASQ test split, 8.4% are filtered out. The corresponding figures are 5.2% for MedQuAD and 7.6% for MASH-QA. This enables comparison of the augmentation methods on a shared population where K-COMP can construct an entity prompt. It leaves the expected behavior on the full question stream unspecified, including questions that the recognizer cannot process. The stricter filter in training adds a possible coverage effect. Terms that correspond to straightforward headings in the corpus are more likely to produce usable examples than terms that cannot be matched under the annotation procedure.
The use of titles and opening sentences also limits what counts as a gold description. An opening sentence can be a suitable short definition, but the rule provides no independent assessment of how complete it is or whether it gives the sense of a term intended in a particular question. The generated test descriptions in turn have no direct factuality score. The paper measures the summary or the final answer downstream. That makes it possible for a useful summary to compensate for a poor description, or for a helpful description to be accompanied by a summary that omits crucial evidence. Each can affect the other during left-to-right generation, and the reported end-to-end score does not separate all of those cases.
The designation “knowledge injection” describes what is placed in the training targets and in the prompt. It does not by itself establish where an individual generated description came from. A correct description could reflect the retrieved passages, information retained during fine-tuning, or knowledge available in the starting Gemma system. The paper does not trace those sources term by term. Likewise, a test question with no matching title annotation can still have a familiar term or relevant retrieved information. Successful generation under that condition shows independence from a mandatory description lookup, while the source of the knowledge remains unresolved.
FineTune and −Prior narrow the explanation of the results in useful ways, but they leave some design choices coupled. FineTune shares the starting architecture and training settings with K-COMP, while K-COMP changes the generation target and uses entity-centered summary supervision. A direct comparison of the two therefore tests a package of changes. −Prior isolates whether the explicit description section helps at the reader stage and keeps any influence those descriptions already had on summary generation. Neither result supplies an isolated estimate of how much of the gain comes from masking the questions, from the description target, or from the way the gold summaries were written.
Automatic scores and judge preferences also have limited authority over individual medical claims. BertScore reflects contextual similarity. UniEval addresses consistency with a reference. The GPT-4o summary assessment asks which text looks useful as supporting evidence. In particular, that assessment can favor a coherent, specialized summary without checking each claim against the underlying retrieved sources. The paper reports agreement between automatic answer measures in several settings. The study has no human evaluation, so that agreement does not establish how medical experts would judge disputed or potentially consequential statements.
The G-Eval sampling description also leaves a reproducibility detail open. The paper reports a random selection of 1k points per dataset, while its dataset statistics list 707 original BioASQ test examples and 647 after filtering. The sampling description leaves the exact BioASQ evaluation population unclear. This affects how precisely the G-Eval results can be mapped onto the main test results. The reported scores still describe the comparison the authors present, while the population used for that particular supplement is less clear than the main split counts.
Finally, the efficiency result is tied to the measured reader, hardware, and prompt lengths. It supports the practical advantage of compressing the larger input in that configuration. The paper evaluates a wide range of readers for answer quality, but the timing test measures Llama-3-70B on MASH-QA. The extra generation stage has a measurable cost, and the shortest raw input completes sooner in that experiment. The retrieval comparison with RAPTOR has a similarly concrete boundary. Its restricted collection and its use of FineTune for tree summaries define the comparison. How the systems would rank under a larger retrieval build or different summarizer remains an empirical question.
What came after
There are no documented follow-up papers to describe. The paper’s own extension beyond its main benchmarks is the MEDIQA evaluation, which tests whether entity-centered summaries remain useful on another collection of medical questions. The authors leave broader transfer across languages and specialist domains, expanded retrieval collections, and evaluation of the method under more demanding medical conditions as open research questions.
Cite
Cite as Jeonghun Cho and Gary Lee. 2025. K-COMP: Retrieval-Augmented Medical Domain Question Answering With Knowledge-Injected Compressor. Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers).
@inproceedings{cho2025k,
title = {{K-COMP: Retrieval-Augmented Medical Domain Question Answering With Knowledge-Injected Compressor}},
author = {Jeonghun Cho and Gary Lee},
booktitle = {Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)},
year = {2025},
doi = {10.18653/v1/2025.naacl-long.351},
url = {https://doi.org/10.18653/v1/2025.naacl-long.351}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/cho-2025-k-comp-retrieval-augmented-medical/