arXiv:2610.38737cs.CVOct 2026

Manuscript Offprint

arXiv:2610.38737

RuleForge: Inferring and Instantiating Latent Visual Rules as Executable Programs

Weifeng Xu, Yaxiong Wang, Zhedong Zheng

Weifeng Xu

mc56486@um.edu.mo

Institute of Artificial Intelligence and

Brain Sciences, University of Macau

Macau, China

Faculty of Information Science and

Computing, University of Macau

Macau, China

Yaxiong Wang

wangyx15@stu.xjtu.edu.cn

Hefei University of Technology

Hefei, China

Zhedong Zheng

zhedongzheng@um.edu.mo

Institute of Artificial Intelligence and

Brain Sciences, University of Macau

Macau, China

Faculty of Information Science and

Computing, University of Macau

Macau, China

Figure

Figure 1: The proposed RuleForge framework for jointly learning visual rule understanding and executable generation. Given a Bongard-Forge100k problem containing six positive and six negative panels, the model selects the separating rule and provides a natural-language explanation. Through a separate generation interface, the corresponding target rule is provided as input, and the model generates an executable scene program that produces new rule-consistent instances under five fixed seeds. "What I cannot create, I do not understand." – Richard Feynman

Abstract

Visual rule reasoning asks whether multimodal models can recover an abstract concept from a few examples. Existing studies either infer rules from visual examples but evaluate only classification or verbalization, or supervise executable generation with rules provided as input. Consequently, the relationship between visual rule understanding and reliable rule instantiation remains insufficiently explored. We present Bongard-Forge100k, a controlled benchmark, together with RuleForge, a backbone-agnostic framework that jointly learns visual rule understanding and rule-conditioned executable generation. The benchmark contains 108,797 problems: 86,000 for training, 19,297 for testing familiar rules, and 3,500 for testing held-out rule compositions. The framework progresses through rule-understanding training, joint understanding and scene-program supervision, and refinement via execution-grounded reinforcement learning with Understanding Replay. Executing generated programs under multiple random seeds provides verifiable feedback on executability, rule satisfaction, diversity, and robustness. With UniLIP as the primary backbone, RuleForge improves multiple-choice accuracy over the base model by 20.93 percentage points on familiar

rules and 28.42 percentage points on held-out rule compositions, while increasing scene-level rule satisfaction on familiar rules from 2.91% to 70.99%. Additional experiments on InternVL3.5, Qwen3-VL, and Show-o2 demonstrate the effectiveness of the proposed training data and framework across diverse multimodal architectures.

CCS Concepts

• Information systems → Question answering; Multimedia content creation; • Computing methodologies → Rule learning; Reinforcement learning.

References (13)