# Robustness and Reasoning Fidelity of Large Language Models in Long-Context Code Question Answering

Source: [Robustness and Reasoning Fidelity of Large Language Models in Long-Context Code Question Answering](<https://www.sota2.com/research/paper/6997ea7009c33900fcd764f5>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-02-21T05:00:04.173Z

Authors: Kishan Maharaj, Nandakishore Menon, Ashita Saxena, Srikanth Tamilselvam

Published: 2026-02-19T09:05:03.000Z

## Abstract

Large language models (LLMs) increasingly assist software engineering tasks that require reasoning over long code contexts, yet their robustness under varying input conditions remains unclear. We conduct a systematic study of long-context code question answering using controlled ablations that test sensitivity to answer format, distractors, and context scale. Extending LongCodeBench Python dataset with new COBOL and Java question-answer sets, we evaluate state-of-the-art models under three settings: (i) shuffled multiple-choice options, (ii) open-ended questions and (iii) needle-in-a-haystack contexts containing relevant and adversarially irrelevant information. Results show substantial performance drops in both shuffled multiple-choice options and open-ended questions, and brittle behavior in the presence of irrelevant cues. Our findings highlight limitations of current long-context evaluations and provide a broader benchmark for assessing code reasoning in both legacy and modern systems.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2602.17183>)

[PDF](<https://arxiv.org/pdf/2602.17183.pdf>)
