Fanglin Xu

Author directory

2026

LLM-based web agents automate browser interactions by generating structured action sequences, yet their deployment in long-horizon tasks is hindered by fragile error propagation in noisy DOM trees. Critically, existing training paradigms rely exclusively on positive supervision from gold demonstrations, teaching models **what** is correct but never **why** plausible alternatives fail, leaving agents unable to distinguish between subtly different yet critically divergent choices. We propose **FailAlign**, a failure-aligned learning framework that systematically integrates error signals as first-class training supervision. We mine a Failure Index from model rollouts by pinpointing first-error steps, then leverage these instances across a three-stage pipeline: (i) action-grounded context compression distills verbose HTML into compact DOM snippets; (ii) hard-negative DPO pairs gold actions with semantically similar incorrect alternatives to sharpen decision boundaries; (iii) trajectory-level GRPO mitigates error cascades by re-simulating corrected trajectories. On Mind2Web with Qwen3-32B, FailAlign achieves **49.7% SSR** and **5.6% SR**, surpassing models 15× larger (Qwen3-Coder-480B: 37.0% SSR) and commercial systems (Claude Opus-4.5: 39.4% SSR), validating the efficacy of learning from failures.
The rapid advancement of code large language models (LLMs) has sparked significant research interest in systematically evaluating their code generation capabilities, yet existing benchmarks predominantly assess models at a single structural granularity and focus on limited programming languages, obscuring fine-grained capability variations across different code scopes and multilingual scenarios. We introduce M2G-Eval, a multi-granularity, multilingual framework for evaluating code generation in large language models (LLMs) across four levels: Class, Function, Block, and Line. Spanning 18 programming languages, M2G-Eval includes 17K+ training tasks and 1,286 human-annotated, contamination-controlled test instances. We develop M2G-Eval-Coder models by training Qwen3-8B with supervised fine-tuning and Group Relative Policy Optimization. Evaluating 30 models (28 state-of-the-art LLMs plus our two M2G-Eval-Coder variants) reveals three main findings: (1) an apparent difficulty hierarchy, with Line-level tasks easiest and Class-level most challenging; (2) widening performance gaps between full- and partial-granularity languages as task complexity increases; and (3) strong cross-language correlations, suggesting that models learn transferable programming concepts. M2G-Eval enables fine-grained diagnosis of code generation capabilities and highlights persistent challenges in synthesizing complex, long-form code.
Industrial code tasks, including chip design, GPU optimization, and firmware, often fail for reasons that are invisible in ordinary source code: timing constraints, backend logs, layout data, simulator behavior, and hardware-specific performance trade-offs. Current code models see many programs but few expert correction traces from these settings. We present InCoder-32B-Thinking, a 32B thinking code model trained with Error-driven Chain-of-Thought (ECoT) synthesis and an Industrial Code World Model (ICWM). ECoT converts several rounds of toolchain signals into reasoning traces by preserving the failed code, the observed failure, and the later fix. ICWM learns from execution traces in domains such as Verilog simulation and GPU profiling, then predicts feedback for the data engine, which can build more repair traces without routing every candidate through a real toolchain. The data keeps the uneven reasoning depth of industrial work: short traces for simple cases, long traces for hardware-level debugging. Across 23 tests (14 general and 9 industrial), InCoder-32B-Thinking reaches 81.3% on LiveCodeBench v5, 84.0% CAD-Coder compile success, and 38.0% on KernelBench L2, while remaining competitive on general coding tasks. Model weights and code are available at Hugging Face: https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder and GitHub: https://github.com/CSJianYang/Industrial-Coder.