Better Understanding Generation (BUG)
- BUG is a research orientation that integrates understanding signals into generation, resulting in outputs like bug reports and test cases that are contextually grounded and diagnostically valuable.
- It employs structured intermediate representations—such as GUI interactions, visual cues, and descriptive annotations—to bridge the gap between generating artifacts and ensuring their interpretability.
- Empirical results in both software defect diagnosis and multimodal image editing demonstrate significant improvements in precision, recall, and overall artifact quality compared to baseline methods.
Better Understanding Generation (BUG), used here as an Editor’s term, denotes a research orientation in which generated artifacts are engineered to improve understanding, and understanding signals are in turn injected back into generation. In the surveyed literature, this orientation appears in two reciprocal forms. In software engineering, it includes generating bug reports, tests, and synthetic bugs that are more actionable for diagnosis, repair, and learning. In unified multimodal modeling, it includes methods that use understanding to guide generation, as well as methods that use generation as an intermediate step for stronger understanding. Across both domains, the recurring objective is not generation in isolation, but generation that carries explanatory, diagnostic, or alignment value (Saha et al., 1 Apr 2026, Lyu et al., 23 Sep 2025, Su et al., 29 Jan 2026, Wen et al., 3 Mar 2026).
1. Conceptual scope and recurrent design pattern
A common structure recurs across the literature: a model is not asked merely to produce an output, but to produce an output grounded in task-specific intermediate information. In BugScribe, the grounding signal is app-specific context such as GUI interactions, screen descriptions, and buggy screen localization. In UTGen, it is contextualized test data, descriptive identifiers, and Given-When-Then comments. In UiG and R3, it is iterative self-evaluation of generated images. In UniMRG and G2U-style systems, it is the generation of auxiliary visual representations or visual thoughts that are subsequently consumed by the understanding pathway (Saha et al., 1 Apr 2026, Deljouyi et al., 2024, Lyu et al., 23 Sep 2025, Ye et al., 17 Feb 2026, Su et al., 29 Jan 2026, Tong et al., 15 May 2026).
This shared pattern has two principal directions. The first is understanding-to-generation, where a system’s understanding module, contextual knowledge, or structured intermediate representation improves the quality of generated outputs. The second is generation-to-understanding, where generated artifacts serve as intermediate evidence, auxiliary supervision, or self-generated visual reasoning states that improve downstream understanding. A plausible implication is that BUG is best understood not as a single algorithmic family, but as a coupling principle: generation becomes valuable when it is constrained by interpretable task structure, and understanding becomes stronger when it can externalize or rehearse intermediate states (Lyu et al., 23 Sep 2025, Pan et al., 6 Mar 2026, Tong et al., 15 May 2026, Niu et al., 25 Nov 2025).
2. Context-grounded generation for software defect artifacts
In mobile software engineering, BUG is exemplified by systems that transform incomplete reports into defect artifacts with higher diagnostic value. BugScribe addresses the problem that manually submitted reports often omit Observed Behavior (OB), Expected Behavior (EB), or Steps to Reproduce (S2Rs). Its pipeline has three phases: App Execution Model Generation, Contextual Information Extraction, and Bug Report Generation (LLM-based). The execution model is graph-based, with nodes representing app screens and edges representing GUI interactions. Contextual extraction includes sentence annotation into OB, EB, S2R, or other; screen description generation; enumeration of valid GUI actions; and buggy screen localization. Generation then uses zero-shot, task-decomposition prompting to synthesize improved OB, EB, and S2Rs (Saha et al., 1 Apr 2026).
BugScribe’s central claim is that context selection must be component-specific rather than generic. For S2Rs, the best context is GUI interactions + screen descriptions + buggy screen. For OB/EB, the best context is buggy screen + generated S2Rs + screen descriptions. This is formalized by a unified quality framework. For S2Rs, each step is labeled as Correct Step (CS), Ambiguous Step (AS), Extra Step (ES), or Missing Step (MS), with , , and as the harmonic mean of precision and recall. For OB/EB, component elements are labeled Correct, Incomplete, Ambiguous, Incorrect, or Missing (Saha et al., 1 Apr 2026).
| Setting | S2Rs F1 | OB/EB elements |
|---|---|---|
| Original | 49.1 | 122 correct / 59 missing |
| BugScribe | 89.6 | 165 correct / 3 missing |
| Best Baseline | 61.2 | 159 correct / 12 missing |
On the reported test set of 48 bug reports from 26 Android apps, BugScribe reaches 89.6 S2R F1 with GPT-5.4, compared with 61.2 for the best no-context baseline, 53.0 for Acharya et al., and 49.1 for the original reports. For OB/EB, BugScribe produces 165 correct elements and reduces missing elements to 3. The paper reports a 44–82% relative improvement on S2Rs and up to 35% relative improvement on OB/EB quality (Saha et al., 1 Apr 2026).
The emphasis on non-code context is consistent with findings on bug localization in deep-learning systems. In a study using 2,365 bugs from deep-learning systems and 2,913 from traditional software, existing localization techniques underperform on deep-learning bugs, and deep-learning bugs are often extrinsic and connected to artifacts other than source code, such as GPU or training data. This suggests that BUG in reporting and triage is especially relevant when actionable context is distributed across GUI state, environment, configuration, and runtime conditions rather than source text alone (Jahan et al., 2024).
3. Tests, specifications, and diagnostic inputs as understanding artifacts
A second software-engineering branch of BUG treats tests themselves as generated explanatory artifacts. UTGen combines search-based software testing and LLMs to improve the understandability of automatically generated unit tests. Its four stages are Test Data Refinement, Post-Processing, Test Naming, and Compilation and Verification. The enhancement mechanisms are contextualizing test data, improving identifier naming, and adding descriptive comments, with comments explicitly generated in the Given-When-Then format. On 346 non-trivial Java classes from 117 open-source projects, UTGen generated 8,430 tests versus 8,315 for EvoSuite, with 72.48% of tests genuinely improved. In a controlled experiment with 32 participants, assignments with UTGen test cases led participants to fix up to 33% more bugs and use up to 20% less time (Deljouyi et al., 2024).
The same principle appears in direct generation of tests from bug reports. A feasibility study on Defects4J bug reports shows that bug reports can be used as natural inputs for generating executable Java test cases. With ChatGPT and five generations per bug report, the reported results are 50% executability, 30% validity, and 9% relevance. The study further reports that generated tests are immediately useful for fault localization and patch validation in automated program repair. Here the generated test is not merely an output artifact; it is an operationalized interpretation of the report (Plein et al., 2023).
At the level of specification comprehension, FiX makes BUG explicit. It treats test cases as probes for misunderstanding before code generation and as signals for repairing the gap between the stated specification and the model’s internalized specification after code generation. Its two phases are thought-eliciting prompting and feedback-based prompting. On ChatGPT, FiX reports HumanEval Pass@1 = 90.24%, compared with 81.71% for the best baseline SCoT+Self-repair, and an average +35.62% relative improvement across six benchmarks (Tian et al., 2023).
For diagnostic input construction rather than final executable tests, DPGen4JIT generates both passing and failing test programs for JIT compiler bug localization. Its core insight is asymmetric: passing inputs should be as similar as possible to the failing seed, while failing inputs should be as different as possible. The suspicious set is formalized as
On 72 optimization bugs, the approach reports a median of 91.2% elimination of non-buggy functions, with overall Top-N localization results of Top-1: 25%, Top-5: 43.1%, Top-10: 54.2%, and Top-20: 69.4% (Lim et al., 2023).
4. Synthetic bug generation and pedagogical BUG workflows
Another branch of BUG generates bugs themselves so that models or humans must understand, localize, and repair them. BugFarm targets two goals that are partly conflicting for learning-based methods: generating bugs that are hard-to-detect and hard-to-repair. Its method extractor isolates methods, an attention analyzer finds Least Attended Statements (LAS) using a Transformer-based model, and the bug generator prompts an LLM to mutate only those locations. The rationale is that multiple modifications can increase repair difficulty, while restricting them to least-attended locations reduces representational drift and therefore detection ease. Over 435k+ bugs from over 1.9M mutants, BugFarm reports bugs with an average 3.08 statements involved, up to 41% higher False Negative Rate, and an automated repair success rate of 22%, compared with 34% for LEAM and 49% for $ (Ibrahimzada et al., 2023).
BugPilot pursues realism through a different mechanism. Rather than instructing an agent to inject a bug directly, it instructs a software engineering agent to add a feature to a containerized repository. If tests fail after the feature is implemented, the snapshot is recorded as a bug instance. This FeatAdd approach is intended to reflect the way bugs arise during ordinary development rather than as isolated local perturbations. The resulting bugs have average patch size 4376 tokens/patch and 4.2 files modified, compared with much smaller and more local baselines. For supervised fine-tuning, the paper reports outperforming other bug datasets by 2% with half the training data (1.2k vs. 3k bugs), and reaching pass@1 of 54.6% for FrogBoss and 45.3% for FrogMini on SWE-bench Verified (Sonwane et al., 22 Oct 2025).
BUG also appears as a pedagogical design. In a study of prompt-centered programming with 2,636 sessions from 917 students, deliberately injected bugs and naturally occurring prompt-related failures elicit different forms of understanding work. Injected bugs more often led to direct code edits, including 68% for initial injected bugs vs. 45% for natural bugs, and yielded ~90% next-attempt success versus ~51% for natural bugs. Natural bugs more often led students to refine prompts, including 52% prompt-following after a natural bug first turn versus 31% after an injected bug. Student reflections emphasized code understanding, code review, debugging, verification, and awareness of GenAI limitations. This suggests that BUG can function as a curricular scaffold that forces a distinction between specification repair and localized code repair (Pădurean et al., 6 Jul 2026).
5. Understanding-to-generation in unified multimodal models
In unified multimodal modeling, the first major BUG direction is the use of understanding to improve generation. UiG, or Understanding-in-Generation, argues that prior reasoning methods separate understanding and generation. Its central device is “Image Editing” as a bridge: the model first generates an image, then uses understanding prompts to diagnose prompt-image mismatch and produce editing instructions, and then edits the image iteratively. The stopping rule is either alignment or a maximum of 4 iterations. On TIIF, UiG reports 71.11% overall on the long prompt setting, a 3.92% absolute gain over T2I-R1, and 69.70% overall on the short prompt setting, a 1.11% absolute gain. On WISE, it reports a 0.16 increment in overall score. Removing the editing bridge causes 4–6% drops in performance (Lyu et al., 23 Sep 2025).
R3, or Reason-Reflect-Refine, frames the same issue as an optimization dilemma: stronger generation often weakens understanding, and stronger understanding often weakens generation. It converts single-step text-to-image generation into a multi-step generate-understand-regenerate loop. The Reason stage produces a plan and initial image, Reflect evaluates the image against the prompt, and Refine edits the image until the model determines that no further edit is needed. On GenEval++, R3 reports 0.689 versus the BAGEL baseline of 0.371. It also reports ITA accuracy rising from ~60.6% to ~73.4% and VQA accuracy from ~86.5% to ~89.6%, with most of the gain attributed to the reflection-refinement component rather than reasoning alone (Ye et al., 17 Feb 2026).
Architectural and post-training approaches express the same principle in different forms. UI-UG unifies UI understanding and generation in a single MLLM built on Qwen2.5-VL-7B, with Supervised Fine-tuning (SFT), Group Relative Policy Optimization (GRPO) for understanding, and Direct Preference Optimization (DPO) for generation. It introduces 19 semantic UI classes, uses >30,000 modern app screenshots, and reports 1.0 format accuracy, 0.974 category accuracy, and 0.559 mAP on understanding tasks, compared with 0.290 for the best cited OmniParser baseline. For generation it reports 42.02 total GenScore, close to 42.15 for Qwen2.5-VL-72B, with 5.2s on 2×L20 GPUs for full generation and 2s with quantization. The paper also reports that joint training on understanding and generation improves both tasks (Yang et al., 29 Sep 2025).
VUGEN makes the alignment problem more explicit. It leverages a VLM’s pretrained visual understanding priors by transforming the vision encoder’s high-dimensional latent space into a lower-dimensional tractable distribution, then training the VLM to sample in that reduced space and decoding with a dedicated pixel decoder. The paper reports improving DPG Bench from 71.17 to 74.32 and FID from 11.86 to 9.06 on COCO, while fully preserving the VLM’s original understanding capabilities (Chen et al., 8 Oct 2025).
GvU moves BUG into reinforcement learning. It defines a token-level intrinsic text-image alignment reward by using the understanding branch to score how well a generated image supports regeneration of the original text prompt:
This reward is then used in a self-supervised GRPO framework. Reported gains include GenEval: 0.68 to 0.81, GenEval++: 0.282 to 0.404, and DPG-Bench: 85.68 overall, alongside improvements on fine-grained visual understanding benchmarks after generation-focused training (Pan et al., 6 Mar 2026).
6. Generation-to-understanding, benchmarks, and unresolved asymmetries
The reverse BUG direction asks whether generation can improve understanding. UniMRG answers by adding auxiliary generation tasks during post-training. Instead of relying only on standard understanding objectives, it trains unified multimodal models to generate pixel, depth, and segmentation representations. These targets are intended to encode appearance, geometry, and structure. For OpenUni-3.6B, the paper reports MMVP: 71.67 → 74.67, Hallusion: 60.88 → 64.56, VSR: 66.69 → 73.90, GenEval: 50.97 → 55.82, and DPGBench: 79.41 → 81.78. The ablation result is central: pixel generation alone improves generation but gives no gain in understanding, whereas depth improves spatial reasoning and segmentation improves hallucination resistance (Su et al., 29 Jan 2026).
A second variant uses inference-time generation as an intermediate reasoning step. The Generation-to-Understanding (G→U) synergy framework performs controlled generative acts such as detail enhancement or context expansion and feeds the resulting visual thoughts back into the understanding decoder, without retraining or external tools. Across twelve benchmarks, the paper reports gains including +1.2% on MMStar, +4.2% on HallusionBench, +1.8% on MMBench, and +1.6% on R-Bench. It also reports that generative fidelity is an upper bound on perceptual improvement, with a significant positive correlation between self-generated image quality and VQA performance, (Tong et al., 15 May 2026).
The most direct controlled analysis of whether understanding informs generation is UniSandbox. Using synthetic, leak-proof datasets, it separates reasoning generation from knowledge transfer. Open-source models without explicit Chain-of-Thought (CoT) nearly fail on both families of tasks. For BAGEL, average reasoning-generation performance rises from 0.028 to 0.510 with CoT. For knowledge transfer, BAGEL rises from 0.06 overall to 0.44 with CoT. UniSandbox also proposes the STARS self-training framework, in which CoT-generated examples are filtered by a verifier and then used to fine-tune the generation head so that reasoning can be internalized implicitly. The paper further argues that query-based architectures exhibit latent CoT-like properties during knowledge transfer (Niu et al., 25 Nov 2025).
At the benchmark level, UniG2U-Bench adds a more cautionary result. It organizes G2U evaluation into 7 regimes and 30 subtasks, using 3,000 carefully curated instances. Its three headline findings are that unified models generally underperform their base VLMs, Generate-then-Answer (GtA) typically degrades performance relative to direct inference, and consistent enhancements emerge mainly in spatial intelligence, visual illusions, and multi-round reasoning subtasks. The benchmark therefore identifies a task-conditional pattern rather than a universal synergy. A plausible implication is that BUG succeeds most reliably when the generated intermediate is a faithful structural transformation of the evidence, not when it is merely an additional sample from the model’s image prior (Wen et al., 3 Mar 2026).
Taken together, these studies define BUG as a bidirectional but nontrivial coupling. In software engineering, the most successful systems supply generation with executable context, structured quality criteria, or realistic failure modes. In multimodal modeling, the strongest gains appear when understanding and generation are connected by explicit intermediate artifacts, intrinsic rewards, or controlled iterative reflection. The same literature also shows clear limits: code-centric localization misses extrinsic bugs, generated intermediates can propagate error, unified models can suffer an alignment tax, and self-generated thoughts often lack stable task alignment. BUG is therefore not a general claim that more generation yields more understanding, but a research program concerned with the precise conditions under which generated artifacts become diagnostically or semantically useful (Jahan et al., 2024, Wen et al., 3 Mar 2026, Tong et al., 15 May 2026).