Evaluating Context Memory in Multi-Turn Video Question Answering

    This article explains how to evaluate and improve the context memory capability of video question answering systems in multi-turn conversations. It breaks down memory into four observable sub-capabilities, presents evaluation sample design principles, defines grouped metrics such as distance-based accuracy, entity-reference error rate, hallucination rate, and consistency, and provides a practical five-step evaluation pipeline with code examples. Finally, it discusses four engineering approaches—explicit entity tables, history summarization, retrieval-based backtracking, and visual evidence caching—to address memory failures in production systems.

    1. Background: Single-Turn Understanding Cannot Support Real Interactions

    Most video understanding systems perform reliably in single-turn question answering, but real-world usage typically involves continuous dialogue. A user might first ask about a visual detail, then follow up with related questions, and finally refer back to earlier answers using expressions like “the first one” or “the one we mentioned at the beginning.” To handle such questions, a model must retain two types of information simultaneously: the entities or conclusions established in earlier turns, and the corresponding video content from relevant time segments.

    Take sports footage as an example. At the start of a conversation, the user asks which player scored on a particular drive. After discussing several other plays, the user finally asks: “The player we first talked about—how many points did he score in total this game?” The model must first recover the correct player, then pull the number from the game statistics. Even if the statistics are read correctly, the answer still fails if the entity is misidentified.

    Film and TV content follows the same structure. The user first discusses a scene from the beginning, then moves on to other characters and plot points, and finally points to a character on screen and asks: “Did this character appear in the scene we discussed at the start?” The model must determine which scene “the beginning scene” refers to, then verify whether that character appears in it. The current frame alone cannot answer this question.

    Both examples share a common trait: the current question depends on dialogue history, and the answer requires aligning linguistic memory with visual evidence. Therefore, single-turn QA accuracy cannot represent a model’s true performance in multi-turn interaction.

    To make evaluation capable of localizing problems, “memory” must be decomposed into independently observable abilities.

    1. Temporal and turn localization: identifying which dialogue turn expressions like “the first time,” “at the beginning,” or “just now” point to. This is the entry point for all backtracking tasks.
    2. Entity binding: retaining the people, objects, and events that appeared in earlier answers, and keeping their references consistent in subsequent questions. Any change or substitution of an entity name leads to errors.
    3. Visual evidence backtracking: determining whether an entity appears in a specified time segment or scene. This requires the model to associate linguistic memory with video clips.
    4. Integrated reasoning: after locating the correct entity and evidence, combining statistics, plot clues, or quantitative relationships to produce the answer.

    These four abilities are chained together. If an earlier step fails, the final answer will be wrong even if the later reasoning is correct. Evaluation design should be able to distinguish between “found the wrong target” and “found the right target but computed the wrong result.”

    3. Principles for Designing Evaluation Samples

    An effective multi-turn memory evaluation set should satisfy the following principles.

    • Explicit dependencies: every question that requires backtracking is annotated with the historical turn it depends on, so the memory distance can be computed.
    • Controllable distance: the number of intervening turns between a question and its referenced history varies, allowing observation of how performance changes with distance.
    • Complete question-type coverage: the set should include at least reference backtracking, attribute backtracking, existence verification, and counting/aggregation questions.
    • Determinable answers: design unique ground-truth answers wherever possible to minimize reliance on subjective scoring.

    Below is an illustrative sample structure; the fields are meant only to explain the design approach:

    1. sample = {
    2. "video_id": "clip_0231",
    3. "turns": [
    4. {"q": "Who just scored on that drive?", "type": "anchor", "entity": "player_A"},
    5. {"q": "Who made the defensive play in the third round?", "type": "normal"},
    6. {
    7. "q": "The player we first talked about—how many points did he score in total?",
    8. "type": "backref_aggregate",
    9. "depends_on": 0,
    10. "answer": 27,
    11. },
    12. ],
    13. }

    Here, depends_on points to the referenced turn index, which the evaluation program uses to compute memory distance. Turns of type anchor establish entities, and subsequent backtracking questions are judged against them.

    4. Grouped Metrics and Calculation Methods

    Overall accuracy hides structural problems, so metrics should be broken down by dimension.

    1. Distance-grouped accuracy

    For backtracking questions at distance d, define:

    acc(d) = number of correctly answered questions at distance d / total number of questions at distance d

    Plotting the acc(d) curve makes it easy to see at what historical distance the model starts to fail. The faster the curve drops, the weaker the model’s ability to retain early information.

    2. Reference error rate

    The proportion of answers in which the referenced entity differs from the ground-truth entity. This metric specifically measures “mistaken identity” problems and is counted separately from numerical or factual errors.

    3. Hallucination rate

    The proportion of answers that cite information present in neither the video nor the dialogue history. Such errors typically manifest as the model fabricating a plausible-looking name, number, or scene.

    4. Consistency across turns

    Whether the name, attributes, or attribution of the same entity contradict themselves across turns. A model might call someone “A” in turn two but switch to “B” in turn five; this kind of drift should be recorded separately.

    Together, these four metrics distinguish among “forgot,” “misidentified,” “fabricated,” and “inconsistent,” providing clear direction for subsequent improvement.

    5. Engineering Practice: Building the Evaluation Pipeline

    Implementing a multi-turn memory evaluation typically involves five steps.

    1. Data preparation: extract frames or segments from videos, and annotate each sample with ground-truth answers and dependencies. Verify during annotation that entity names are consistent.
    2. Session construction: ask questions turn by turn according to the script, retaining the complete message history so the model operates in a genuine multi-turn context.
    3. Inference and logging: save the model output, context length, and latency for each turn, making it easier to troubleshoot truncation or timeout issues later.
    4. Result judgment: numerical questions can use exact matching or a tolerance range; entity questions require an alias mapping so the same person is not misjudged due to different forms of address.
    5. Grouped analysis: aggregate metrics by question type, memory distance, and video length, and keep raw outputs for spot checks.

    The core logic for running a session can be written as the following illustrative code:

    1. def run_session(model, video, turns):
    2. history = []
    3. results = []
    4. for turn in turns:
    5. reply = model.chat(video=video, history=history, question=turn["q"])
    6. history.append({"role": "user", "content": turn["q"]})
    7. history.append({"role": "assistant", "content": reply})
    8. results.append(judge(reply, turn))
    9. return results

    Here, model.chat is a hypothetical interface; the actual call depends on the inference framework in use. The key points are that the message history must accumulate turn by turn, and the judging logic must read the ground-truth answer for each turn.

    Common problems in practice include the following.

    • Context truncation: when a session becomes too long, earlier turns may be dropped, making backtracking impossible. The actual input length should be recorded in evaluation logs.
    • Sparse frame sampling: if key frames are not sampled, the model lacks evidence, and the resulting errors can easily be misattributed to memory problems.
    • Overly lenient judging rules: fuzzy matching may mark wrong answers as correct; periodic manual review of samples is recommended.
    • Data leakage: if samples overlap heavily with training data, scores will be inflated; deduplication checks are necessary.

    6. Engineering Approaches to Improving Memory Capability

    After evaluation identifies problems, improvements can be pursued in the following directions.

    1. Explicit entity table

    During the session, write the people, objects, and conclusions established in each turn into a structured state—for example, “entity name, first-seen turn, related attributes.” For subsequent questions, resolve references by looking up the table first, then proceed to reasoning. This approach is low-cost and interpretable, making it a good first step.

    2. History summarization and compression

    Generate summaries of earlier turns, retaining entities, numbers, and key conclusions while discarding pleasantries and redundant phrasing. Compression reduces input length, but summaries may omit details, so the metric differences before and after compression should be verified through evaluation.

    3. Retrieval-based backtracking

    Build an index over past question-answer pairs, recall relevant turns based on keywords in the current question, and inject that content into the context. Retrieval suits long sessions with many turns, but recalling the wrong turns introduces noise, so the recall count and ranking strategy need to be controlled.

    4. Visual evidence caching

    Save intermediate descriptions of already-analyzed segments, such as “entity X appears during time segment Y.” Later existence or time-related questions can reuse these descriptions directly, reducing repeated inference and making it easier to audit evidence sources.

    Each method involves trade-offs. Explicit entity tables are the most stable but costly to maintain; summarization saves space but may lose details; retrieval-based backtracking is adaptable but depends on recall quality; evidence caching facilitates auditing but requires handling cache invalidation. In practice, start with an entity table to cover the most common reference problems, then decide based on evaluation curves whether to introduce the other techniques.

    7. Summary and Recommendations

    The memory capability in multi-turn video question answering is fundamentally about aligning linguistic history with visual evidence. When evaluating, split metrics by memory distance, question type, and error type instead of looking only at an aggregate score. When building the pipeline, pay special attention to three common problems: context truncation, frame sampling, and judging rules. When improving the system, start with an explicit entity table, then combine it with summarization or retrieval as needed, and use the distance-decay curve as the primary basis for validating improvements.