RepairFormer用Transformer自动修复损坏的JSON等文件,保留内容,修复率88%,速度比现有方法快5倍。
RepairFormer将结构化输入修复建模为监督序列生成任务,使用格式标签和oracle验证确保输出有效。其边界修复流程只针对检测到的故障区域,降低了输入规模,可支持修复更长的文件。评估中修复率达到88%,恢复率94%,在修复成功时内容保留最强。额外基准上修复97.57%、恢复94.29%,运行速度比现有方法快5倍。
RepairFormer: Automated Repair of Structured Inputs Using Transformers
Structured input files such as JSON, DOT, OBJ, INI, S-expression, and TinyC are widely used in software systems, but small corruptions can cause parsers to reject otherwise useful data. Repairing such inputs is important because malformed configuration, program, and data files can interrupt testing, analysis, deployment, and downstream automation even when most of the original content remains intact. Existing repair techniques can produce structurally valid inputs, but they often rely on deletion or repeated search, which may lose original content and result in semantic incorrectness. This paper presents RepairFormer, a transformer-based framework for structured input repair. The approach formulates repair as a supervised sequence generation task and uses format tags, oracle validation, and boundary-localized repair to generate valid outputs while preserving content. The boundary workflow focuses generation on the detected fault region, reducing the input size, and supporting repair of longer files. In evaluation, RepairFormer achieves a 88% in repair and 94% in recovery, showing strongest content preservation when repairs are successful. Additional experiments on our benchmark shows RepairFormer repairs 97.57% and recovers 94.29% with 5x faster runtime compared to state of the art.