Elamur Research

Context Matters: Pushing the Boundaries of Open-Ended Answer Generation with Graph-Structured Knowledge Context

Paper · 2024 · Somnath Banerjee, Amruit Sahoo, Sayan Layek et al.

Summary

A technical forum can contain the information needed to answer a question without containing a thread that answers it outright. An old discussion might explain a command, another might describe the circumstances in which it works, and a third might use much the same vocabulary for a different problem. GraphContextGen tackles this difficulty in community question answering. The authors ask whether an answer generator can make better use of past discussions when it retrieves them through a network of related questions and supplements them with explicit relationships drawn from the retrieved text and Wikidata.

The system starts with the title and body of each archived question. It connects questions whose numerical representations are similar, then adds the incoming question to the same network. A ranking procedure called personalized PageRank uses the new question as its starting point and considers the connections among older questions when choosing which ones to retrieve. Their accepted answers accompany them. Next, the system identifies entities, such as software tools, and extracts relationships expressed in those discussions. It consults Wikidata for further relationships between entities already identified in the retrieved material. The generator receives the original discussions alongside short statements made from those relationships. The authors test both a pretrained generator and one adapted to forum question–answer pairs.

The experiments use later questions from AskUbuntu, Unix, and ServerFault, with older posts supplying the retrieval archive and training material. The instruction-tuned GraphContextGen configuration has the highest BERTScore, a measure of similarity to the accepted answer, in the main comparison on all three test sets. Its scores are 0.840 on AskUbuntu, 0.837 on Unix, and 0.839 on ServerFault. The picture changes with the metric. On AskUbuntu, for example, AnswerBot achieves ROUGE 1 of 0.236, while GraphContextGen scores 0.214 on the same measure of word overlap. In human comparisons against a generator answering without retrieved examples, the GraphContextGen answer wins 58% of the comparisons on AskUbuntu, 63% on Unix, and 53% on ServerFault.

The authors also compare the entities and relationships in generated and accepted answers. The entity overlap indicates that the system frequently brings the right technical subjects into its response. The error analysis shows why that is only part of grounding an answer. A retrieved discussion can address the wrong operation, leave a part of the question unanswered, or supply instructions for an outdated version. The experiments establish where structured context improves agreement with forum answers and where readers prefer the result. They also show how much still depends on the relevance, coverage, and currency of the material that reaches the generator.

Deep dive: Context Matters: Pushing the Boundaries of Open-Ended Answer Generation with Graph-Structured Knowledge Context

GraphContextGen retrieves related forum questions and adds knowledge-graph facts to help generate answers for AskUbuntu, Unix, and ServerFault. · about 35 minutes to read

The problem and its context

From finding a discussion to answering a question

Community question answering gives users a place to describe a problem and invite other people to propose solutions. The title may identify the general issue, while the body contains the detail that changes the answer. A report of intermittent network failure, for example, looks different once the writer explains that it began after an update. A search result about general network diagnostics may share many of the same terms. A discussion about reversing an update may be more useful because it addresses the condition that makes this case distinctive. Both kinds of results appear in the paper’s retrieval examples.

The task is open-ended because the system has to compose an answer. A response may recommend a particular approach, explain when to use it, or describe alternatives. An accepted answer gives the researchers a concrete reference for evaluation. Other answers may also be useful, and a new response can vary in wording, scope, or organization while addressing the same problem. The accepted answer makes the experiment possible at scale while leaving room for disagreement about what constitutes the best response.

The authors describe AskUbuntu, Unix, and ServerFault as low-resource settings because suitably annotated data for their technical topics is scarce. The communities still supply a meaningful archive of questions and answers. That combination matters. A past answer can contain valuable subject knowledge without having been annotated for which part solves the problem, what prerequisites it assumes, or when its advice ceases to apply. The paper uses the community’s own acceptance signal to obtain question–answer pairs and reserves additional human effort for evaluating generated responses.

Pretrained generators can produce fluent technical prose from a question alone. The paper motivates external grounding by pointing out that such systems may have a knowledge cutoff, struggle in specialized settings, and produce plausible but inaccurate claims. The cited research on knowledge stored in their parameters and on hallucinations frames the cost of relying on pretraining alone. Adding a source at answer time gives the system access to material beyond what it can recall from training. Whether that material improves the response depends on which source reaches it. How Much Knowledge Can You Pack Into the Parameters of a Language Model? · Sources of Hallucination by Large Language Models on Inference Tasks

The authors also raise a practical tradeoff. Larger generators can be costly to use, particularly for researchers with limited computing resources. Their design leaves room for improvement elsewhere in the pipeline. A useful older answer may give a smaller generator details that a larger generator would otherwise have to supply from memory. The zero-shot survey and the later context comparisons approach that question from different directions. One asks how several generators perform when answering from the question alone. The other asks how far the researchers can improve the input to a chosen generator.

What the earlier approaches supplied

The related work covers answer selection and answer summarization. Answer selection ranks existing candidates. The cited approaches include manually designed features, systems based on convolutional or recurrent networks, and attention mechanisms intended to improve matching between a question and possible answers. The paper also cites work using structured comparisons between texts, including earlier work on tree edits for entailment and answer matching. In each case the comparison between pieces of text matters before an answer can be selected or composed. Probabilistic Tree-Edit Models with Structured Latent Variables for Textual Entailment and Question Answering

Several cited systems move from selection toward writing or assembling a response. AnswerBot finds related questions, selects useful answer paragraphs, and builds a summary from them. Its choice of paragraphs takes into account features such as relevance, entity overlap, and information associated with the post or its author. The final selection is designed to cover useful material while limiting redundancy. GenQA generates a response from a set of candidates supplied by answer-selection systems. TechSumBot ranks material from Stack Overflow, identifies important sentences, and removes repeated information. These methods already address the problem that a user may need to draw on several responses.

The authors place those systems alongside work on text summarization that uses graphs or controls what a generated summary covers. Graph-based summarization can use the relationships among pieces of text to decide which material is salient. Keyword-guided generation gives the writer a way to steer the subjects a summary includes. These precedents give graphs and explicit content cues different jobs. GraphContextGen applies a graph to the process of choosing old threads, then uses relation statements as additional input to the generator. Opinosis · CTRLsum

The other strand is retrieval-augmented generation, in which a search component supplies external material along with the question. The paper presents retrieval as a central design choice because the generator sees only the material selected for its input. The authors note a practical difficulty with text retrieval over collections divided into chunks. The size of a chunk determines how much surrounding information comes with a match. A short chunk can leave out the condition that makes a statement useful, while a long one can bury it among less relevant details. In their own comparisons, the main text baseline works with whole questions and fetches the accepted answers after ranking. That comparison tests question ranking directly. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks

Direct ranking by semantic similarity assigns each archived question a score against the new question. It can retrieve questions that use different wording, as long as their representations are close. The authors’ graph starts from the same general notion of similarity and retains relationships among the archived questions as well. A question’s relevance can then depend on how it sits among other connected discussions. The system still needs a later stage to identify the knowledge expressed in the answers. Connections among posts and relationships among the things discussed in those posts are separate kinds of structure. Preserving that distinction makes the method and its comparisons easier to follow.

The method, step by step

The path from a new question to an answer

Consider a reader asking how to extract an ISO file, the example used in the paper to show the generation prompt. The system has older discussions about tools for that task, including a discussion comparing an ISO utility with other options and a question about free tools on Ubuntu. It retrieves those discussions with their accepted answers. It then identifies the tools mentioned in those answers and expresses some of the relevant relationships in short statements, such as the association between 7-Zip and ISO extraction. The final prompt gives the generator both the threads and the relation statements, together with the new question.

That procedure has three parts. The retriever finds archived questions by ranking a graph centered on the new query. The context enhancer turns relationships from the retrieved material and Wikidata into compact text. Finally, the answer generator writes a response from the expanded prompt. The first part determines which community experience comes into view. The second highlights particular entities and relationships within that evidence. The final part decides which information makes sense in an answer to the current question.

How GraphContextGen prepares and answers a forum question

The steps in order.

How GraphContextGen prepares and answers a forum questionStep 1: Represent archived questions by title and body1. Represent archived questions by title and bodyStep 2: Connect similar questions in the archive2. Connect similar questions in the archiveStep 3: Add the query and rank nearby questions3. Add the query and rank nearby questionsStep 4: Retrieve selected questions and their accepted answers4. Retrieve selected questions and their accepted answersStep 5: Extract entities and relationships from the retrieved text5. Extract entities and relationships from the retrieved textStep 6: Add Wikidata relationships between those entities6. Add Wikidata relationships between those entitiesStep 7: Append the relationships as short statements7. Append the relationships as short statementsStep 8: Generate an answer from the query and context8. Generate an answer from the query and context

The paper uses the accepted answer in two places. An archived question’s accepted answer can be shown to the generator as context. The same type of question–answer pair also supplies the target during fine-tuning, when the generator is adapted to the domain. The accepted answer to a test question serves as a reference for evaluation. That answer stays outside the query prompt. Keeping these roles distinct matters when interpreting the results, since access to older accepted answers is part of the method being tested.

Representing the archive

The paper describes the community collection as a set of pairs. Its notation can be written plainly as follows.

⟨Q, A_Q⟩ = {(q₁, a_q₁), (q₂, a_q₂), …, (qₙ, a_qₙ)}

Here Q is the collection of questions, and A_Q denotes their associated accepted answers. Each q with an index is an individual question, and a with the corresponding q subscript is that question’s accepted answer. The index runs from 1 to n, where n is the number of pairs in the collection. Parentheses enclose a pair, braces enclose the collection of pairs, and the ellipsis stands for the intermediate pairs.

The retriever uses a pool drawn from that collection.

Q_pool ⊂ Q

Q_pool is the set of archived questions eligible for retrieval, Q is the larger collection, and ⊂ denotes the subset relationship used in the paper. For the temporal experiment, the older split supplies the retrieval pool. The separate symbol q, without a collection index, denotes the incoming question. The algorithm refers to it as the anchor query because the ranking is organized around it.

The graph uses an embedding for each question. An embedding is a numerical representation that allows the system to compare texts even when their wording differs. The paper describes joining the title and body representations for a question, then comparing questions by cosine similarity. Cosine similarity measures how closely the directions of vectors agree. The authors use FlagEmbedding’s bge-large-en and report an embedding dimension of 1024. They compare BGE with Sentence-BERT separately, so the choice of representation can be examined even in a retriever that has no graph ranking.

Questions become nodes in a question–question graph. An edge says that the representations of the linked questions are similar enough to pass a cutoff. That is a statement about the questions as texts. The edge does not encode a Wikidata relationship between their entities or a judgment that the same answer would work for both questions.

G = (V, E), with V = Q_pool and E ⊆ Q_pool × Q_pool

G denotes the archive graph, V its node set, and E its edge set. Each node represents a question in Q_pool. The symbol × gives the set of possible pairs from the pool, and ⊆ says that the actual edges are drawn from those pairs. The similarity rule determines which eligible pairs are connected.

sim(q_a, q_b) > T

The function sim returns cosine similarity for q_a and q_b, two archived questions under comparison. The letters a and b distinguish the questions. T is the connection threshold, and > requires the score to exceed it. The reported value of T is 0.8. The authors say graph density informed the threshold choice and say the hyper-parameter values were obtained through grid search. The graph’s density affects how widely a ranking signal can travel from the query and how much work the ranker must do.

Ranking from the incoming question

A new question is represented in the same way as the archive questions. The retriever compares it with the archived nodes and creates query edges using the same threshold. The extended graph includes the old relationships as well as those just found for the incoming question.

G′ = (V′, E′), with V′ = V ∪ {q} and E′ = E ∪ E_q

The prime marks an extended version of a graph or set. G′ is the query-specific graph, V′ its nodes, and E′ its edges. The original node and edge sets are V and E. The set {q} contains the one incoming question, while E_q contains the edges from that question to qualifying archived nodes. The union symbol ∪ combines the sets. In this form of the notation, the original graph can be reused while the extension changes with each query.

Direct cosine retrieval would now sort archived questions by their individual scores against q. The graph procedure instead applies personalized PageRank. One way to understand it is to imagine a walk that follows links and repeatedly returns its attention to the query. An archived question’s ranking depends on how it is reached through those links as well as on the query’s immediate connections. The ranking is personalized because it is recomputed from the perspective of the current query. An archived node can matter for one query and be peripheral for another.

Q_ranked = sort(QueryAwarePageRank(G′))

Q_ranked is the resulting ordering of archived questions. QueryAwarePageRank is the algorithm’s name for the personalized ranking on G′. The sort operation orders questions by that score. The query node itself is left out of the selectable results. The authors set the PageRank parameter α, which controls the weight given to following the graph, to 0.85. The iteration cap, max_iter, is 100, and the convergence tolerance, tol, is 1e-6. The tolerance controls when the iterative calculation can stop because further changes are sufficiently small.

The number of retained questions is denoted by k. The paper sets k to 2 so that the expanded context fits within the generator’s input limit. The first k archived questions in the ordering form the retrieval result. Their accepted answers are then looked up. As a consequence, an answer can contribute to the prompt even when the wording that made the original question easy to retrieve appears only in its title or body. The search scores guide which questions are selected, and the answers add the information that can help solve the problem.

C_q = ⟨Q_qtopk, A_Q_qtopk⟩

C_q is the initial context for query q. Q_qtopk denotes the set of the top k questions for that query, and A_Q_qtopk denotes their accepted answers. The angle brackets indicate that the selected questions and answers are carried forward together. The context uses the full paired material available to the next stage, which can then extract statements from either side of a pair.

Extracting and expanding relationships

The context enhancer starts with those retrieved pairs. It performs information extraction by looking for entities and the relations that connect them. The authors use REBEL, a relation extractor, and also prompt a generator to extract relations from the same context. In the algorithm, the output of this stage is a set of triples. A triple has a head, a relation, and a tail. The head is the entity from which the relation runs, and the tail is the other endpoint. The relation explains how they are connected. Its value is the role it gives to a name. Mentioning an archive utility and stating what that utility can do supply different amounts of information.

τ_init = {(h, r, t) extracted from C_q}

The Greek letter τ denotes relational triples, and the subscript init identifies the initial set obtained from the discussions. In each triple, h is the head entity, r the relation, and t the tail entity. C_q is the initial retrieved context. The braces indicate that the relations extracted from that context are collected as a set. This is the head–relation–tail order used by the algorithm and by the step that turns the relations into statements.

The enhancer collects the endpoints of the initial triples into an entity set. It then queries Wikidata, a knowledge graph whose entries and links make relationships between entities explicit. Starting from an entity recognized in the discussions, the system looks up its immediate neighbors, meaning entities it can reach by following a single relation. The tail of a retrieved Wikidata triple has to appear in the previously collected entity set. The lookup can therefore supply an additional relationship between entities already present, while the endpoint filter keeps the context centered on those entities.

τ′ = {(h, r, t) ∈ τ : h ∈ Ent(C_q) and t ∈ Ent(C_q)}

Here τ is the set of candidate Wikidata triples for the extracted heads, and τ′ is the subset that survives filtering. The symbol ∈ means membership. Ent(C_q) is the entity set constructed from the initial triples extracted from C_q. The colon introduces the conditions for admitting a triple. The head h is in that entity set by construction of the lookup. The test on the tail t keeps only triples whose other endpoint also belongs to the set. The relation r is the link obtained from Wikidata for the two endpoints.

The endpoint condition gives a precise sense in which the retrieved discussions constrain external knowledge. A term that was never recognized as part of the initial material cannot enter the added Wikidata statements as a new tail. Even a relationship that could help answer the query can be lost in this way. Conversely, two recognized entities may share a relationship whose relevance to the current question is uncertain. The rule limits the search space by using the discussion’s subject matter. The generator still has to judge whether an admitted relation belongs in the answer.

τ_f = τ_init ∪ τ′

The final triple set is τ_f. The subscript f stands for final. The union combines the original triples τ_init with the retained Wikidata triples τ′. Keeping the initial triples gives the generator explicit statements of relationships already expressed in the forum material. Keeping the filtered external triples allows it to see relationships whose endpoints were recognized in that material even if extraction from the threads did not produce that link.

The authors turn each triple into a short sentence by writing the head, relation, and tail in sequence. For the ISO question, the resulting context includes uses of extraction tools and other properties of tools named in the discussions. Some statements emphasize the central task. Others preserve information that may matter when choosing among alternatives, such as whether a tool is paid or commonly associated with mounting an image. The generator sees those statements alongside the passages they supplement, which can carry distinctions too detailed for a short relation.

C_enc^q = C_q ⊕ S

C_enc^q is the enhanced context for q, with enc marking the enhanced form. C_q is the original set of retrieved question–answer material, and S is the sequence of statements built from τ_f. The symbol ⊕ means concatenation. The representation passed to the generator is thus text assembled from multiple sources. Neither graph has to be traversed by the generator itself.

The worked ISO example shows the result of the assembly. The older answers discuss choices such as Archive Manager, 7-Zip, and mounting the image. The extra statements single out what those tools are associated with. The generated response takes the form of a list of options and distinguishes easier file-manager techniques from approaches aimed at readers comfortable with command-line tools. The example illustrates selection and reorganization of the retrieved material. Its place in the paper is to demonstrate the prompt and output, with aggregate evidence coming from the test sets and human evaluation.

Training and using the generator

In the pretrained condition, the authors supply the query and context to an existing generator and use its response as the output. Retrieved question–answer pairs function as examples in the prompt, an instance of few-shot learning. The generator can use these pairs both for their subject matter and as examples of how a forum question is answered. Adding relation statements provides further context at the same point in the process.

For the adapted condition, the authors first prepare instruction data separately for each community. They use the older questions as instructions and their accepted answers as target responses. The formatting marks where the question instruction ends and the answer begins. The authors call this supervised instruction tuning because the generator is trained on examples with target outputs. The tuning examples teach it to produce a forum-style response from a technical question. The retrieval pipeline independently supplies question-specific material at answer time.

D_INST = ⟨INST, Q_pool, A_Q_pool⟩

D_INST denotes the instruction-tuning dataset. INST is the instruction and corresponding formatting, Q_pool supplies the older questions, and A_Q_pool denotes their accepted answers. The angle brackets indicate the ingredients used together in the training data. Each example associates a question from the pool with its own answer.

M′ = SupervisedFineTuning(M, D_INST)

M is the pretrained generator and M′ the version after adaptation. SupervisedFineTuning is the training procedure, and D_INST is the community-specific instruction dataset. The prime here indicates a change to the generator through training. It has a different role from the prime on G′, which indicates a query-specific extension of the retrieval graph.

The appendix reports LoRA for parameter-efficient adaptation and a 4bit quantization setting. LoRA trains an adaptation with limited additional parameters, and quantization represents weights at reduced precision. The training settings include a learning rate of 2e-4, batch size of 4, gradient accumulation of 1, and 10 epochs. The authors also give a weight decay of 0.001, a cosine learning-rate schedule, a warmup ratio of 0.03, and a maximum gradient norm of 0.3. The LoRA settings are rank 64, scaling parameter 16, and dropout 0.1. The appendix names paged AdamW with 32bits and indicates bf16 in its training settings.

a_gen^q = M′(C_enc^q, q)

The symbol a_gen^q denotes the generated answer for q. M′ is the instruction-tuned generator, C_enc^q is the enhanced context, and q is the incoming question. In the corresponding pretrained condition, the paper uses M in place of M′. It denotes the ground-truth accepted answer by a_gt^q, where gt identifies the reference used to score the result. The generator’s inputs are the query and its assembled context. The comparison with a_gt^q takes place after generation.

How the retrieval cost depends on the archive

The paper analyzes the retrieval work for a single test query through the PageRank calculation. The vector dimension is fixed, so it treats a cosine comparison as constant-time in the size of the question pool. Comparing the query with every archived question then scales linearly with the number of archived nodes.

n_q × O(1) = O(n_q)

In this analysis n_q is the number of archived questions, × denotes multiplication, and O expresses an asymptotic upper bound. O(1) means that one comparison has constant cost with respect to n_q. The right side gives the resulting order of the comparisons needed when a query is added.

The ranking calculation works over the extended graph. The authors count the existing nodes and edges, plus the query and its new links. Their complexity discussion uses e_q for the existing edge count and e′ for the number added with the query. Those lower-case symbols denote counts, distinct from the edge sets in the graph notation.

O((n_q + 1) + (e_q + e′)) = O(n_q + e_q)

The 1 accounts for the incoming node. The plus signs add the node and edge contributions. Each new edge joins the incoming question to an archived question, so e′ is bounded by n_q. The simplification on the right absorbs the extra node and query edges into the terms for archive size and original edge count. With the reported cap on PageRank iterations, the paper gives this bound for the per-query process up to ranking.

O(n_q + n_q²) = O(n_q²)

The superscript ² denotes a square. In a dense graph the number of existing edges can grow quadratically with the archived question count, giving the stated worst case. These bounds describe the part of inference that compares the query and ranks questions. The complete pipeline also entails constructing the archive graph, extracting relations, accessing Wikidata, and generating the answer. Each stage has work beyond the operations counted in the paper’s retrieval bound.

Experiments and results

The collections and the split

The authors take questions from AskUbuntu, Unix, and ServerFault, using community data considered as of June 2023. The records include question titles and bodies, candidate answers, the indication of an accepted answer, tags, and posting dates. For the experimental target, the accepted answer represents the reference response. The authors remove duplicate questions, filter answers that are insufficiently specific, and apply length constraints to fit the generators’ input limits. They then randomly sample the test sets because of resource constraints.

The temporal split gives the retriever and the tuning procedure older material and asks the system to respond to newer posts. The training years are 2019-20 and the test years are 2021-23, as labeled in the dataset table. AskUbuntu has 15,505 training pairs and 203 test pairs. Unix has 19,742 training pairs and 241 test pairs. ServerFault has 10,908 training pairs and 226 test pairs. The setup models a recurring use of a technical forum, in which a newly posted question has to be answered with information from previous discussions.

The table also reports average lengths for questions and answers. On AskUbuntu, the average question length is 254.38 in training and 156.65 in testing, while the average answer length is 122.22 in training and 217.16 in testing. On Unix, the average answer lengths are 181.17 for training and 210.02 for testing. The ServerFault figures for average answer length are 145.30 and 161.73 for the same splits. Thus the archive examples supply older answers that are, on average, shorter than the references used in testing. The article’s scores compare each generated response with its accepted answer under these actual conditions, including differences in how much detail the available examples and reference contain.

The temporal design also bears on the interpretation of retrieval. An old question can be closely related to a new one even if its accepted solution has aged. A generator might use a thread to understand the kind of issue involved while needing different details for the newer case. The designated train and test periods make this tension part of the task. The data procedure gives the system a historically earlier archive, and the error examples show that deciding which of its details still apply is a further problem.

What the scores measure

The paper uses ROUGE, BERTScore, and FactSumm for automatic evaluation. ROUGE 1 measures overlap at the level of individual words or tokens. ROUGE L is sensitive to overlap in sequence order. The tables report ROUGE as macro-F1, which balances the matching material in the generated answer with the matching material in the reference and averages across cases. These measures reward different aspects of surface agreement. An answer can use much of the same vocabulary while organizing the advice differently. A literal overlap measure is especially informative when the same technical names or expressions are needed in both answers.

BERTScore compares generated and reference text through contextual representations, giving credit to matches in meaning that may use different words. This makes it suitable for a task where accepted and generated answers can phrase a point differently. A high score represents close agreement under that measure. Whether the precise steps in a generated response are usable remains a further question, especially if a minor-looking difference changes the command, component, or version involved.

FactSumm extracts facts from both the generated response and the reference, then scores agreement and mismatch among the extracted material. It brings the evaluation closer to differences in claims. At the same time, the score depends on what the extraction procedure recognizes and on what the accepted response says. BERTScore, ROUGE, and FactSumm therefore give complementary views of similarity to the reference. The paper adds entity overlap and human judgments to examine aspects of generation that a single automatic metric leaves unresolved.

Baselines and the choice of generator

The authors first survey generators in a zero-shot setting, where the input is the question without retrieved examples. The table spans Phi at 1.5B through Falcon at 40B and includes systems with the same parameter counts but different training histories. On AskUbuntu, Llama2 at 13B records BERTScore of 0.810, ROUGE 1 of 0.227, and ROUGE L of 0.211. The same generator records BERTScore of 0.806 on Unix and 0.819 on ServerFault. It has the highest displayed BERTScore on each of the three zero-shot test sets and becomes the common generator for the main comparisons. Llama 2

Size alone does not explain the reported ordering. On AskUbuntu, Falcon at 40B scores 0.721 in BERTScore, while Phi at 1.5B scores 0.803. On ServerFault, their BERTScores are 0.812 and 0.790 respectively. On that benchmark Falcon is ahead of Phi, while Llama2 at 13B is ahead of both. This is a comparison among released systems with different training and design choices. It gives the authors a basis for selecting a generator and describes the behavior of the actual candidates available for the study. It offers no isolated estimate of changing the parameter count while holding the rest of a system fixed. Phi-1.5 technical report

The main experiment compares GraphContextGen with both earlier systems and several variants using the common generator. The earlier systems are AnswerBot, GenQA, and TechSumBot. The text retrieval baseline, TextGen, ranks training questions directly by cosine similarity and passes the best matches with their actual answers to the generator. The authors describe vector database implementations using ChromaDB and FAISS. TextContextGen uses the same retrieval approach and then applies the context enhancer. GraphGen retrieves through the question graph and supplies the selected pairs without the additional relationship statements. GraphContextGen combines graph retrieval with the enhancer.

Each of these context conditions appears with a pretrained and an instruction-tuned generator. The main table marks the pretrained variants with “w/o INST.” A separate FineTuned Gen Zero-Shot row applies instruction tuning and then gives the generator only the new question. That row shows how far adaptation alone takes the system. The four context settings, in turn, make it possible to compare retrieval and enhancement while retaining the same tuning status.

What the main comparison shows

The strongest result for the full system is its BERTScore across the three test communities. On AskUbuntu it reaches 0.840, compared with 0.833 for instruction-tuned TextContextGen and 0.827 for instruction-tuned GraphGen. On Unix it reaches 0.837, compared with 0.834 for TextContextGen and 0.817 for GraphGen with instruction tuning. On ServerFault it reaches 0.839. Both instruction-tuned TextContextGen and GraphGen score 0.831 there. The advantage over those controls is visible on every test set, with the nearest competitor varying by community.

BERTScore on the AskUbuntu test set

The instruction-tuned system with graph retrieval and context enhancement scores highest in this comparison.

BERTScore on the AskUbuntu test setAnswerBot: 0.803AnswerBot0.803Llama2 zero-shot: 0.810Llama2 zero-shot0.810FineTuned Gen Zero-Shot: 0.815FineTuned Gen Zero-Shot0.815TextGen with instruction tuning: 0.821TextGen with instruction tuning0.821GraphGen with instruction tuning: 0.827GraphGen with instruction tuning0.827GraphContextGen without instruction tuning: 0.831GraphContextGen without instructiontuning0.831TextContextGen with instruction tuning: 0.833TextContextGen with instruction tuning0.833GraphContextGen with instruction tuning (this paper): 0.840GraphContextGen with instruction tuning(this paper)0.840
The numbers
System or settingBERTScore
AnswerBot0.803
Llama2 zero-shot0.810
FineTuned Gen Zero-Shot0.815
TextGen with instruction tuning0.821
GraphGen with instruction tuning0.827
GraphContextGen without instruction tuning0.831
TextContextGen with instruction tuning0.833
GraphContextGen with instruction tuning (this paper)0.840

The AskUbuntu comparison helps separate several choices. The score rises over the bare zero-shot generator when the authors use instruction tuning alone. The text retrieval and graph retrieval conditions each do better than that tuned generator answering without retrieved context. Adding relation statements to the text-retrieved examples yields another competitive result. The full system combines the strongest reported AskUbuntu BERTScore with both forms of graph use. The intermediate scores show that a large part of the useful context can already come from direct retrieval and a suitable enhancement procedure.

FactSumm gives the full system a favorable result on AskUbuntu and Unix. On AskUbuntu, instruction-tuned GraphContextGen reaches 0.639, compared with 0.636 for both instruction-tuned TextContextGen and GraphGen. On Unix it reaches 0.693, compared with 0.689 for TextContextGen and 0.691 for GraphGen in the same tuned setting. On ServerFault the ordering differs. The full tuned system scores 0.737 there, while tuned TextContextGen reaches 0.739. That distinction matters because the automatic score most directly based on extracted facts favors a text-retrieval variant on this dataset, even as the full system leads in BERTScore.

FactSumm on the Unix test set

The full instruction-tuned configuration leads the tuned alternatives on extracted-fact agreement.

FactSumm on the Unix test setFineTuned Gen Zero-Shot: 0.661FineTuned Gen Zero-Shot0.661TextGen with instruction tuning: 0.684TextGen with instruction tuning0.684GraphContextGen without instruction tuning: 0.685GraphContextGen without instructiontuning0.685TextContextGen with instruction tuning: 0.689TextContextGen with instruction tuning0.689GraphGen with instruction tuning: 0.691GraphGen with instruction tuning0.691GraphContextGen with instruction tuning (this paper): 0.693GraphContextGen with instruction tuning(this paper)0.693
The numbers
System or settingFactSumm
FineTuned Gen Zero-Shot0.661
TextGen with instruction tuning0.684
GraphContextGen without instruction tuning0.685
TextContextGen with instruction tuning0.689
GraphGen with instruction tuning0.691
GraphContextGen with instruction tuning (this paper)0.693

Word overlap gives a more mixed result. On AskUbuntu the full system records ROUGE 1 of 0.214 and ROUGE L of 0.189. AnswerBot gets ROUGE 1 of 0.236, and the pretrained GraphContextGen variant gets ROUGE L of 0.206. On Unix the tuned full system scores 0.187 for ROUGE 1 and 0.169 for ROUGE L. On ServerFault it gets 0.198 and 0.181 respectively. Its ServerFault ROUGE 1 matches several competitors, and its ROUGE L is the highest displayed in the main comparison there. Those results place the BERTScore gains in context. More agreement under contextual matching sometimes accompanies more lexical overlap, and sometimes the measures favor different ways of writing the answer.

The main comparison marks the full system with a significance annotation for comparisons with the earlier systems. The paper specifies a p-value threshold below 0.05 for that comparison. The annotation has that scope. The nearby scores for the retrieval and enhancement variants are descriptive comparisons in the table, and the mark gives no basis for treating every pair of adjacent values as statistically separated. This is especially relevant when deciding whether a narrow lead is evidence of an advantage on an individual test set or part of a pattern across settings.

What the grounding and human checks add

To see whether the outputs discuss the same things as the references, the authors use UniversalNER for named entity recognition. It identifies entities in the generated and accepted answers. The evaluation compares the resulting sets using Jaccard similarity, which is the number of shared entities divided by the number of distinct entities appearing in either set. If the generated answer adds unrelated entities or misses ones central to the reference, its score can fall. GraphContextGen attains entity Jaccard similarity of 0.85 on AskUbuntu, 0.75 on Unix, and 0.79 on ServerFault. UniversalNER

The grounding analysis also examines overlap in relational triples and presents a distribution of triplet matches. The comparison asks a stronger question than whether a few software names appear in both answers. Two responses may mention the same utility and still describe different uses for it. Matching a triple can capture agreement on how an entity is related to something else. The reported numerical entity scores and the triplet distribution describe correspondence to accepted answers. A complete check of whether the relationships hold in the conditions specified by a new question would require evidence beyond that correspondence.

The human study brings in judgments about the response itself. The authors recruited nine computer science undergraduates with experience contributing answers to the relevant communities. They assigned them in groups of three to the datasets. Each participant rated 50 instances individually using Doccano. The rating scale runs from 1 for a misleading or unhelpful answer to 5 for an exemplary one. The predominant rating for the GraphContextGen output is 4 on AskUbuntu and Unix and 5 on ServerFault. These are the most common ratings described by the authors, so they should be read as features of the rating distributions.

The authors also report which answer the participants preferred when comparing GraphContextGen with standard zero-shot generation. On the sampled human evaluation cases, the win rate is 58% for AskUbuntu, 63% for Unix, and 53% for ServerFault. Each is above the 50% comparison line used in the paper. Unix has the largest reported preference, even though its entity Jaccard score is the lowest of the three. ServerFault has the highest predominant absolute rating and the smallest win rate. These observations make sense together because the measures ask different questions. An answer can rate well in isolation while its zero-shot competitor is also acceptable, and a preferred answer can address the problem well while using a different set of entities from the reference.

What the ablations show

Better representations help direct retrieval

The authors organize the dedicated ablation study around the representation used to retrieve questions, the choice of retrieval method with a single example, and the source of relation statements when those statements are the only context. The table reports one score per dataset for each variant. Its caption and column labels leave that score unnamed, so the row comparisons can be read directly without attaching a more specific metric label to them.

The embedding comparison uses pretrained TextGen in both settings and changes the representation used for matching. On AskUbuntu, the reported ablation score is 0.808 with Sentence-BERT and 0.812 with BGE. On Unix, it is 0.783 with Sentence-BERT and 0.809 with BGE. On ServerFault, the scores are 0.803 and 0.810 respectively. BGE is ahead in all three paired comparisons. The separation is most apparent on Unix. Because these runs use direct text retrieval, the difference is attributable to the representation choice within that pipeline rather than to the introduction of PageRank.

This comparison matters when someone tries to explain the full system’s improvement. The graph starts from embedding similarity, so the same representation affects which edges can be made and which neighbors the query has at the outset. A better direct match can already supply a more useful prompt. The authors’ control shows that ranking and representation are both consequential design choices. Its scope is the reported direct retriever. The table supplies no comparable full graph run in which the embedding alone is changed.

Graph retrieval with one example

The one-shot comparison limits both pretrained generators to a single retrieved question and answer. The paper reports AskUbuntu scores of 0.809 for TextGen and 0.818 for GraphGen. On Unix the corresponding scores are 0.807 and 0.809, and on ServerFault they are 0.807 and 0.812. With the same number of examples, the graph variant is ahead on each dataset. The scores are close enough that the comparison is best read as a consistent direction in the tested setting.

The example count matters because it controls a simple alternative explanation. If one retriever could pass several threads while another had only one, differences could come from the amount of evidence available. Here the comparison emphasizes which item is ranked first. The earlier examples illustrate how that item can change. For the question about network failures following an Ubuntu update, personalized PageRank retrieves a discussion focused on rolling back an update. Direct similarity retrieves a question about troubleshooting tools. The first result picks up the update as a possible cause, while the second covers the network symptoms more generally.

The log-rotation example adds a qualification. The graph retriever surfaces a question about scheduling the script, while direct similarity retrieves general practices for handling log files. The scheduling discussion is more specific, and it still may address only one aspect of why a rotation-and-compression script misses files. Specificity and completeness are different. The examples show the kinds of changes the retriever can make in its top result, while the one-shot table measures how its outputs fare across the sampled cases.

What remains when the threads are removed

The context-only variants supply the relational material without the original question–answer passages. One starts from text-retrieved discussions, and the other starts from graph-retrieved discussions. The labels FT and FG identify those retrieval origins in the ablation. Both are knowledge-graph-context variants. The comparison therefore asks whether the relation statements derived from different sets of retrieved discussions differ in usefulness when the full passages are unavailable to the generator.

On AskUbuntu the reported ablation score is 0.819 for the context from text and 0.827 for the context from graph. On Unix the scores are 0.807 and 0.820. ServerFault gives 0.819 for the text-derived context and 0.818 for the graph-derived context. The discussion in the paper describes the graph-derived setting as ahead across the platforms. The displayed ServerFault values show a small reversal. The numerical result supports an advantage for the graph-derived setting on AskUbuntu and Unix, and a near tie with the opposite ordering on ServerFault.

This experiment shows that the compressed relationship statements can bear useful information even when the thread text is removed. It does not isolate the contribution of Wikidata alone. The enhancer combines relations already present in the threads with those brought in through Wikidata, and the FT and FG labels change how the threads were chosen. A controlled estimate of the effect of external facts would require matching the retrieval and extraction steps and varying whether the external triples are included. The paper’s experiment instead compares the output of the enhancer under alternative retrieval inputs.

The main table offers a complementary comparison. With instruction tuning and graph retrieval fixed, adding the enhancer moves Unix BERTScore from 0.817 for GraphGen to 0.837 for GraphContextGen. The corresponding Unix FactSumm scores are 0.691 and 0.693. This gives evidence that the expansion of the prompt helps under those settings, with a larger separation on the similarity measure than on the extracted-fact measure. On ServerFault, tuned GraphGen and tuned GraphContextGen both score 0.737 in FactSumm, while their BERTScores are 0.831 and 0.839. The enhancer can improve agreement under one measure even where an added benefit is invisible under another.

Where the pipeline goes wrong

The retrospective error analysis follows the evidence through the stages of the method. A retrieval mismatch can arise before any entity or relationship is extracted. In one example, a question about changing the desktop environment retrieves material about changing the wallpaper. The archive passage is relevant to the word “desktop” and may be accurate on its own terms. Passing the passage to the generator encourages a response about a different operation from the one requested. This is a case where better extraction of the same source would preserve the mismatch.

Entity errors can follow even when the topic is broadly relevant. The paper illustrates this with a question about chmod for which the system brings in details about chown. The closely related subject matter makes the resulting response sound plausible in context, while the wrong utility makes it unresponsive. The endpoint filter used for Wikidata cannot resolve that problem on its own. By the time it applies, choosing which entity a name denotes has already shaped the input to the lookup.

Other examples concern coverage and currency. A composite question asks about granting SSH access and arranging FTP transfers. The retrieved discussion and the response focus on SSH, leaving the file-transfer part untreated. A question about upgrading to the latest Ubuntu release receives guidance for an older transition. That answer can accurately reproduce part of the historical evidence while failing the current request. A final example retrieves a post that acknowledges an error without providing a solution. Rewriting such a post into a polished answer cannot supply the missing diagnosis. Across these cases, the source may be off target, incomplete, stale, or too thin to support an answer with sufficient detail.

Limitations

Limits identified by the authors

The authors identify the accuracy and coverage of the knowledge graph as conditions on the method’s success. Missing information restricts what the lookup can add. Incorrect links can introduce claims that the generator then presents fluently. A filtered set of Wikidata statements inherits limitations from both the graph and the entity extraction that led to it. When a technical detail changes, an archived discussion and a knowledge graph entry may also reflect different points in time. The paper identifies keeping the knowledge graph current and adapting the generator to new information as unresolved issues.

The authors also note that a generator inclined towards summarization may omit details that matter in technical advice. A concise response can lose a prerequisite, a version condition, or the circumstances under which an alternative is safer. Ambiguity makes it harder to know which details to preserve. Their error cases include questions whose meaning depends on the specific component intended by the user and compound questions that need more than one procedure. The paper further identifies potential biases arising in the construction of knowledge graphs and in generator training, along with the difficulty of reaching the specificity of a purpose-built system.

Scaling poses a separate problem. More archive questions can mean more pairwise similarity comparisons to construct the graph, more edges for ranking, and more potential relations to extract or expand. The authors flag the cost of processing large knowledge graphs. Their retrieval bound exposes the dependence on graph density and establishes a worst case for the query-stage computation they analyze. Wall-clock latency, storage, and total inference cost would also depend on the extraction, Wikidata access, and generation stages. The experiments with several generator sizes do not give a complete system-cost comparison.

Limits visible in the evaluation

The test sets come from technical communities with related subject matter and from a particular temporal split. The results show how the pipeline handles sampled later questions for those archives. They leave its behavior open for forums whose threads have different conventions, fewer accepted answers, or specialized entities with weaker Wikidata coverage. The use of posting dates also controls the age of the forum material available to retrieval and instruction tuning. It gives less information about the provenance of pretraining data or which state of Wikidata the experiment represents. A strong result under the split is evidence about this retrieval setup, with no corresponding guarantee that all information used by the generator was contemporaneous with a test question.

The accepted answer is a practical reference whose limits the authors themselves acknowledge. A generated answer may cover the user’s problem well and give options omitted by the accepted post. An older accepted answer may also be sparse or its technical assumptions may be unclear. ROUGE, BERTScore, and FactSumm can penalize a useful departure or reward agreement with an incomplete reference. Their scores are most informative when read as measures of correspondence. Establishing that a procedure works on the specified system would require checking its conditions and behavior independently of the reference.

The entity and triple analyses add finer-grained evidence while retaining that dependence. A high Jaccard score means that the generated response mentions much of the same entity set as the accepted answer. It can still attribute the wrong role to a shared entity. A matching triple captures an additional relationship, yet technical claims often depend on qualifiers such as a release, configuration, or stage of a procedure. The reported overlap measures leave the handling of such qualifiers uncertain unless the extraction represents and compares them explicitly.

The human study shows that the proposed output is frequently preferred to a standard zero-shot answer. Its reported head-to-head comparison uses that baseline, while the automatic experiment also includes stronger alternatives with text retrieval and context enhancement. The human results consequently leave open whether readers would prefer GraphContextGen to a tuned TextContextGen response when both have access to relevant examples. The participants bring experience in their communities, but the judgments come from a small evaluation panel. The descriptions of the ratings and wins do not establish how consistently individual reviewers agreed or how precisely the preferences would carry over to another sample.

The written procedure also leaves some details unresolved. Reproducing the enhancer requires deciding how references to the same entity are aligned, how to handle conflicting relations, and what to do when a useful entity is absent from the initial triples. The reported threshold and context size are tied to the authors’ graph density and input budget. A query with few connections or a query that needs several distinct threads could behave differently under those settings. The ablations demonstrate behavior under particular alternatives, while leaving an independent estimate of these boundary cases for further evaluation.

Finally, instruction tuning, graph ranking, relation extraction, Wikidata filtering, and prompt assembly all influence the final response. The paper’s variant comparisons separate some of these choices, and its examples illustrate plausible failure paths. An observed score gain for the full workflow can reflect several improvements together. The comparison that adds the enhancer, for instance, adds both explicit statements extracted from forum text and filtered external statements. The evidence supports the performance of the combined method and gives partial evidence about its components. It leaves the relative contribution of those different sources of relation text unresolved.

What came after

Ding and colleagues’ survey on data augmentation using large language models cites GraphContextGen. Its stated scope includes how data is augmented, the learning settings in which augmentation is used, and the challenges that arise. GraphContextGen is a relevant example of augmentation at answer time. Its generator receives extra material selected for an individual question, while instruction tuning separately uses existing forum pairs as training examples. This distinction helps locate the contribution in the survey’s broader subject. The citation establishes that the survey takes account of the paper. A specific reuse of the question graph, replication of the forum experiments, or extension of the reported results cannot be attributed to the survey on that basis. Data Augmentation using Large Language Models

Cite

Cite as Somnath Banerjee, Amruit Sahoo, Sayan Layek, Avik Dutta, Rima Hazra and Animesh Mukherjee. 2024. Context Matters: Pushing the Boundaries of Open-Ended Answer Generation with Graph-Structured Knowledge Context. Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: Industry Track.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2024.emnlp-industry.23

@inproceedings{banerjee2024context,
  title = {{Context Matters: Pushing the Boundaries of Open-Ended Answer Generation with Graph-Structured Knowledge Context}},
  author = {Somnath Banerjee, Amruit Sahoo, Sayan Layek, Avik Dutta, Rima Hazra and Animesh Mukherjee},
  booktitle = {Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: Industry Track},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-industry.23},
  url = {https://doi.org/10.18653/v1/2024.emnlp-industry.23}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/banerjee-2024-context-matters-pushing-boundaries-open/