acceptodds
Under review as a conference paper at ICLR 2027

Layout Beyond Format: Internalizing Spatial Execution in LLMs via Element-Level Geometric Rewards

Abstract

Large language models generate visual code—SVG, HTML, slide scripts—that is almost always syntactically valid, yet the rendered layouts frequently exhibit spatial defects; existing systems compensate through repeated inference-time detection and rewriting, at a cost that accumulates with every call. We observe that models do not lack spatial judgment: they reliably identify and follow spatial constraints, yet fail to maintain them during autoregressive generation. This local planning failure lies in the decoding process itself rather than in understanding, long context, or format syntax, and since the cause is format-agnostic, layout ability should be acquired once, at the format-agnostic level. We therefore build a two-stage framework that first generates a format-agnostic layout skeleton and then realizes it into code of any target format, making planning an independently supervisable object, and post-train on top of it: SFT distills two-stage trajectories, and RL uses a verifiable dense reward from a geometric detector that attributes every defect to the tokens that produced it, alongside a page-level outcome reward. A 9B model trained this way raises its end-to-end delivery rate from 25.6% to 85.6%; the two-stage formulation on its own, without training, does not help—it lowers the same model to 17.1%—so the gain comes from internalizing the geometric signal into the weights rather than from the scaffold. As the diagnosis predicts, the resulting layout ability transfers zero-shot to code formats absent from all training data and improves quality and efficiency inside an established agentic pipeline.

Primary area:
applications to computer vision, audio, language, and other modalities
Keywords:
LLM, layout generation, visual code generation, RL, verifiable step rewards

Reviews

Among:
Shape:
1234this paper, Bottom 27%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.00 over 3 reviews, above 27% of the others.
Reviewer_iW7COpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper studies layout errors in LLM-generated visual code such as SVG. The method first generates a layout skeleton and then the final code, using SFT to learn this process and RL to assign geometric penalties to the tokens of defective elements. The authors also propose an inference-time stepwise detect-and-rewrite mechanism to identify and locally fix layout errors during generation. Evaluation is mainly conducted on a custom 450-task benchmark, with additional tests on cross-format transfer and an existing PPT agent workflow.

Critical strengths
  1. I like the overall design of the method. The structured layout skeleton makes spatial constraints explicit and easy to verify, which naturally supports both inference-time correction and element-level reward assignment during RL. These components fit together quite well.
  2. The experimental improvements are substantial. The ablation against outcome-only GRPO supports the effectiveness of fine-grained geometric rewards, and the experiments within an existing agentic workflow provide further evidence of its practical value.
Critical weaknesses
  1. The evaluation relies heavily on a custom benchmark and author-defined geometric metrics. Although the paper includes some additional evaluations, the lack of validation on established benchmarks for related tasks makes it difficult to assess the generalizability of the reported improvements.
  2. The main experiments only compare against general-purpose LLMs, without comparisons to existing specialized methods for slide or SVG generation, including some cited in the paper. This makes it difficult to assess the method's performance relative to prior work.
Questions for authors
  1. Could the authors evaluate the method on an existing benchmark for visual code or layout generation? Any suitable benchmark would be helpful.
  2. Could the authors include comparisons with some existing specialized methods, particularly those already cited in the paper, such as IntroSVG, AeSlides, or GeoSVG-RL? Even one or two representative comparisons under the same evaluation setting would help establish the method's effectiveness relative to prior work.
  3. Table 21 provides an important ablation of training and inference-time correction, and I think it deserves more discussion in the main text. Also, could the authors clarify the inconsistent LQS results for Qwen3.5-4B (base, two-stage) between Tables 10 and 17 (12.6 vs. 13.8)?
1 comment

Response to Reviewer 3

Thank you for recognizing the value of our framework and its effectiveness in an agentic workflow. We address the evaluation setting, specialized methods, and the two table-related questions below.

Critical Weakness 1 / Question 1: Use of established benchmarks

The original tasks in existing SVG, webpage, and slide benchmarks are not always fully compatible with ours. Our task is to generate dense, content-complete visual pages from text across multiple code formats. Some benchmarks, for example, take images as input or focus on vector illustrations, whereas we assess whether specified content is delivered in a layout that satisfies spatial constraints. Directly comparing published scores would therefore conflate different inputs and outputs.

Nevertheless, we have made as much use of existing benchmarks as our unified setting allows. Our 450 evaluation tasks include examples from Design2Code, WebCode2M, PPTAgent, Slide2Code, Zenodo10K, and pptx_templates. We reformulated them as a common text-to-page task and generated each in the target formats. We also applied selected PPTEval-style and WebGen-Bench-style evaluation criteria to the outputs. Our main measures—overlap, spacing violations, misalignment, text overflow, out-of-bounds elements, content coverage, and delivery—capture layout issues shared across these applications. Thus, our evaluation draws extensively on existing data and evaluation methods. We will also clarify that reformulating these tasks is not equivalent to running any one benchmark under its complete original protocol.

To further test generalization under an unchanged public protocol, we have prepared the VGBench/VGen text-to-SVG prompts and a fixed pilot manifest. We will report its official metrics alongside our layout and delivery measures.

Critical Weakness 2 / Question 2: Comparisons with specialized methods

Our existing ablation already addresses part of this methodological comparison. AeSlides uses composite criteria to score a completed slide and a GRPO-family method to optimize a page-level outcome reward. Our outcome-only GRPO arm examines a similar reward granularity in our task. With the model, training data, and outcome term held constant, adding our element-to-token reward raises SVG end-to-end delivery from 77.1% to 88.0% and reduces overlap from 0.07 to 0.02 per page. This controlled ablation supports the value of localized geometric feedback and can also be viewed as an ablation analogous to the AeSlides approach.

In addition, the outputs of IntroSVG may be more oriented toward illustrative graphics than toward layout tasks like ours. The different styles of the resulting artifacts lead to different priorities in training and evaluation, which is why we did not fully follow its setup. GeoSVG-RL focuses on technical diagrams with connector and graph constraints, unlike our dense, content-bearing pages. These task differences explain why we did not directly juxtapose their published scores with ours.

In follow-up work, we will draw on ideas from IntroSVG and GeoSVG-RL and implement them, where feasible, as ablations in our experimental setting.

Question 3a: Why is Table 21 in the appendix, and what does it show?

Thank you for highlighting Table 21. Due to main-text space constraints, we placed the full training stage × inference strategy × feedback strategy ablation in the appendix. We agree that its main conclusions deserve more discussion in the main text. This ablation helps assess whether the gains in the trained models merely result from using more steps and tokens. In particular, adding a further stepwise detect-and-rewrite round after two-stage generation with the trained models does not yield a clear additional gain, suggesting that the inference paradigm matters beyond simply increasing inference cost. We will expand the main-text discussion of these findings.

Question 3b: Why do Tables 10 and 17 report different LQS values?

Thank you for catching this inconsistency. For the Qwen3.5-4B base model with two-stage inference, 12.6% is the correct value, matching the archived aggregate score report and Table 10. The 13.8% entry in Table 17 was an oversight when we filled the table. We will correct Table 17 to 12.6% and check the related text and tables for consistency.

Reviewer_Sq1AOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper aims to reduce layout errors in LLM-generated pages and reliance on repeated inference-time repair. It separates layout planning from code realization, uses SFT to teach this procedure, and then applies RL with element-level geometric penalties and a page-level reward. On 450 SVG tasks, the 9B model's end-to-end delivery rate rises from 25.6% to 85.6%. The authors also evaluate transfer to unseen code formats and an existing slide-generation workflow.

Critical strengths
  1. The performance gains are substantial. Training raises the 9B model's end-to-end delivery rate on SVG tasks from 25.6% to 85.6%.

  2. The method applies to several layout settings. The experiments cover layouts for webpage, slide, and report content, and demonstrate its use in an existing PPT-generation workflow.

Critical weaknesses
  1. The element-level penalty can also fall on correct content. Equation (1) splits an overlap penalty equally between both elements, then distributes each share uniformly across the corresponding token span. If one element already occupies its required position and only the other is misplaced, the correctly placed element still receives a penalty. The rule identifies participants in a conflict, not which generation decisions need correction. Its attribution is therefore coarser than the paper's claim of precisely targeting the tokens responsible for a defect suggests.

  2. The paper does not report a full evaluation on an established benchmark under its standard protocol. The authors sample 450 instances from several sources, reformulate them as text-to-page-code tasks, and evaluate them primarily with their own metrics. Adopting scoring methods such as PPTEval is not equivalent to evaluating on the original benchmarks. It therefore remains unclear whether the gains hold on established tasks under their standard settings, and direct comparison with published results from related methods is difficult.

Questions for authors
  1. The ablation in Section 5.4 supports the added reward module, but Eq. (1) also introduces defect-type weights and severity, whereas the defect term in Eq. (4) simply counts errors and excludes out-of-bounds violations. How do the existing results distinguish the benefit of a more detailed scoring rule from that of assigning penalties to specific elements' tokens?

  2. Table 7 shows that overlapping elements tend to be close in generation order. However, spatially neighboring elements may naturally be generated consecutively. What evidence rules out this ordering effect when attributing the errors to local planning failure?

  3. Appendix A.1 samples approximately 100 tasks from the evaluation suite for diagnosis, and Appendix A.4 states that offline outputs from A.1 are used to calibrate reward parameters. Are those tasks still included in the final 450-task evaluation?

  4. Why are there no direct comparisons with closely related methods such as AeSlides and GeoSVG-RL, discussed in Related Work?

4 comments

Thank you for the detailed comments. We respond point by point.

Critical Weakness 1: Why are both elements penalized for a pairwise layout violation?

We agree that a symmetric penalty can reach an element that should remain fixed. Unlike text overflow, overlap, spacing, and misalignment are relational: neither participant is necessarily wrong in isolation. Without a reference placement or counterfactual correction, the detector cannot usually identify a unique culprit. We therefore split pairwise penalties equally to teach their spatial relationship. This heuristic may penalize a correctly anchored element; it does not imply both must move. We will clarify that the reward identifies participants and their code spans, not unique causal culprits, and compare symmetric, asymmetric, and reference-based assignments.

Critical Weakness 2: Why is there no full evaluation under an established benchmark's standard protocol?

Our 450-task suite reformulates several sources as dense, content-complete text-to-page generation, with comparable layout and delivery measures across SVG, HTML, LaTeX, and PPTX and format-specific validity checks. It tests our target setting but is not a standard benchmark run: using selected PPTEval or WebGen-Bench criteria does not reproduce their original inputs and full protocols. External generalization thus needs further testing.

We have prepared VGBench/VGen prompts and a fixed pilot manifest. We will use its original task and official metrics, reporting our geometry and delivery measures separately and noting that VGen targets vector graphics rather than dense pages. We are also preparing a native SlidesBench evaluation, pending its complete reference assets. We will report results in a follow-up; no new benchmark scores are claimed here.

Question 1: What do the existing ablations establish about detailed scoring and token-level assignment?

The equations serve different purposes. Equation (1) assigns element-derived penalties to their token spans, using defect-family weights and severity, including out-of-bounds (OOB) violations. Equation (4) scores page-level coverage, defect count, and fill; its group-normalized advantage is shared across the response and discourages omitting content. Its defect count excludes OOB. These are complementary reward components at different granularities.

In the 4B ablation, adding Equation (1) to the same model, data, and outcome reward raises SVG end-to-end delivery from 77.1% to 88.0%; overlap falls 0.07→0.02, spacing 0.04→0.02, and overflow 0.07→0.05 per page. Under its inference settings, the separate training-free study also favors element- over page-level detect-and-rewrite in layout quality: 53.3 vs. 45.2 on Qwen3.8-27B and 43.4 vs. 33.3 on Kimi-K3. These results support local feedback and are consistent with the value of element-token routing.

However, the RL ablation tests the whole Equation (1) module; it cannot separate detailed scoring from token assignment. We will compare the same family-, severity-, and OOB-aware score assigned response-wide versus to participating token spans, then compare detailed versus unweighted scores under fixed assignment and defect families. We will match SFT initialization, outcome reward, reward scale, prompts, rollout budget, and training steps. Results are pending.

Due to the character limit for comments, further content will be provided in the next reply.

Question 2: Could Table 7 reflect the ordinary generation order of spatial neighbors?

Nearby elements may naturally be generated consecutively; Table 7 alone cannot exclude this. In an exploratory analysis of separate archived one-shot SVG outputs, we matched each overlapping pair to a non-overlapping pair on the same page by element type where possible and nearest center distance, excluding background-sized shapes and low-severity overlaps. We compared their serialized SVG order gaps; types matched in 99.3% of pooled comparisons.

Archived model groupMedian order gap: overlapping pairMedian order gap: spatially matched, non-overlapping pairOverlapping pair has a shorter gapMedian spatial-distance mismatch
Qwen3.5-9B8316.7%70.38 px
Kimi-K31262.9%4.24 px
Qwen-SFT4.510.562.2%0.13 px
Pooled3660.7%0.75 px

The pooled, Kimi-K3, and Qwen-SFT results retain an association after this limited matching. The pattern is not uniform: Qwen3.5-9B has few eligible conflicts and poor spatial matches. Restricting to same-type matches with center-distance mismatch at most 10 px gives median gaps of 3 vs. 7.5, with shorter overlapping gaps in 59.3% of comparisons.

This analysis was absent from the submission and uses different outputs from Table 7. It remains descriptive: within-page observations are dependent, controls may be reused, and matching omits element size and group membership. We will report group sizes, analyze the original outputs with these controls and page-level inference, and frame Table 7 as consistent with, rather than proof of, local planning failure. “Order gap” is the difference between serialized element indices, one greater than the number strictly between them.

Question 3: Were the diagnostic cases also included in the final evaluation?

Yes. Appendix A.1's approximately 100 diagnostic cases correspond to 90 distinct source documents in the archived manifests, all retained in the final 450-task SVG evaluation. They come from D2C and Case50; the full suite includes other sources. Appendix A.4 states that their offline outputs also informed global reward calibration.

Available training-ID lists show no exact source-case-ID overlap with the 450 evaluation tasks, so this is not direct SFT/RL example reuse. Calibration used aggregate offline outputs to set global parameters, not case-specific target layouts, but could still favor these sources. We will report the original 450 tasks, the 360 diagnosis-unseen tasks, and an independent public benchmark, noting the subset's changed source mix. New results are pending.

Question 4: Why are there no direct AeSlides or GeoSVG-RL comparisons?

AeSlides scores completed slides with composite criteria and optimizes a page-level outcome reward using a GRPO-family method. Our outcome-only GRPO ablation tests a similar reward granularity; it does not reproduce AeSlides' reward shaping, normalization, or full system. GeoSVG-RL targets box-and-connector technical diagrams rather than dense content pages. These task and protocol differences preclude direct comparison of published scores.

We will compare AeSlides on a slide-compatible task and GeoSVG-RL on a diagram-compatible task where runnable artifacts permit, using identical metrics within each setting and documenting adaptations. The public SVG benchmark offers another shared setting for runnable methods. We will report completed comparisons in a follow-up.

Thank you for the detailed response, which clarifies several of my questions. However, many of the experiments most relevant to my assessment are still described as pending or planned for a follow-up. Could you provide an update on their current status and report any available results during the discussion period?

Thank you for the suggestions. We have completed additional evaluations and would like to share the results.

VGen evaluation. We evaluated on 2,000 VGen prompts and ran IntroSVG on the same prompts.

MethodValid SVGLongCLIP ↑FID ↓
Base 9B94.5%0.236448.9
SFT 9B57.3%0.231560.8
Our RL 9B94.0%0.232175.3
IntroSVG, initial output88.4%0.223539.6
IntroSVG, after three revisions63.7%0.226343.0

The clearest effect of RL is on the chance of producing a usable SVG: validity rises from 57.3% after SFT to 94.0% after RL, while LongCLIP among valid outputs remains similar. This is consistent with our training objective, which gives feedback on completed visual code and its geometric defects. The result suggests that RL helps the model produce reliable outputs without a revision loop, even on an external task. VGen focuses on illustrations rather than dense pages, and its visual-quality results are mixed. LongCLIP and FID are computed on valid outputs, so their sample sets differ across methods.

Reward ablation. AeSlides combines several verifiable slide-level criteria with GRPO-style optimization. Its reward is applied at the level of the completed slide, making it similar in reward granularity to our outcome-only GRPO arm. Our arm provides a comparison within our own task and training setup; it does not reproduce AeSlides' full system.

Using checkpoints at the same training step, end-to-end delivery on our 450 tasks rises from 85.1% with outcome-only reward to 87.1% with our dense reward. On the 360 tasks outside the diagnosis and reward-calibration subset, SFT, outcome-only RL, and dense-reward RL achieve 28.9%, 83.3%, and 85.8%, respectively. We are preparing targeted ablations to measure the contributions of detailed scoring and token-level assignment separately.

Reviewer_wsMEOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

Within the manuscript, authors discovered that, LLMs generate visual code (SVG, HTML, slides) that is almost always syntactically valid, yet the rendered pages often have spatial defects: overlaps, text overflow, misalignment, and elements out of bounds. In the evaluation, frontier models produce a clean page on only 15–35% of tasks in a single call. Current fixes are inference-time loops (render, check, repair), which cost extra compute on every call. The authors conclude the failure happens during decoding. The model doesn’t keep track of where it just placed nearby elements. Since this is a decoding problem rather than a syntax problem, authors predict that layout skill learned in one format should transfer to others.

This work proposed a two-stage generation style. The model first writes a format-agnostic layout skeleton in JSON (regions, roles, sizes, line and font budgets). It then turns that skeleton into code in the target format. Two-stage trajectories are distilled from Opus 5. A trajectory is kept only if it passes four gates: well-formed skeleton, source coverage, defect-free render, and coverage check. Then, the RL with an element-level dense reward is designed, as the paper’s main novelty. A geometric detector assigns each defect to the element that caused it. The penalty is then spread over the tokens that wrote that element, weighted by defect family (overflow is the most costly, spacing the least).

Based on reported experimental result, per end-to-end delivery on SVG, the 9B model goes from 25.6% to 85.6%, and the 4B from 32.4% to 88.0%.

Critical strengths
  • The authors proposed a easy-to-utilize two-stage strategies. It crosses skeleton × feedback granularity on five backends and includes matched-budget null controls. The model effects has been somehow well checked.

  • The manuscript provide a well-engineered reward. The main idea is to trace each geometric defect to the element that caused it, then to the tokens that wrote that element, and penalize those tokens directly, which provides a real advance in credit assignment.

Critical weaknesses
  • It seems to me that the RL process, per major novelty, does not always end up a significant gain on the experimental result, as shown in HTML and PPTX.

  • There have been a couple of prior arts, using RL to handle layout problem. More comparison against these methods is missing:

Rodriguez, J., Zhang, H., Puri, A., Pramanik, R., Feizi, A., Wichmann, P., Mondal, A., Samsami, M.R., Awal, R., Taslakian, P. and Gella, S., 2026. Rendering-aware reinforcement learning for vector graphics generation. Advances in Neural Information Processing Systems, 38, pp.60496-60534. Liu, S., Mao, F., Zhou, S., Zhan, Y., Tan, W., Lu, Z. and Liang, Z., 2026. RefineSVG: Visual Feedback-Driven Reinforcement Learning for Image-to-SVG Generation. arXiv preprint arXiv:2607.27699. Pan, Y., Hu, C., Huang, X., Huang, C., Zhao, M., Bi, Y., Zhang, X., Zeng, A. and Hu, L., 2026. AeSlides: Incentivizing Aesthetic Layout in LLM-Based Slide Generation via Verifiable Rewards. arXiv preprint arXiv:2604.22840. Li, S., Cai, Y., Chen, H. and Wang, Y., 2026. GeoSVG-RL: Geometry-Aware Reinforcement Learning for Layout-Constrained Text-to-SVG Diagram Generation. arXiv preprint arXiv:2605.25447.

Questions for authors

Could authors leverage how the algorithm shall generate a visual code with multiple layers of layout, stage 1 per described within the manuscript. What I'm talking about the multiple layers of layout means that there might be skeletons within one element recursively.

What I'm not sure neither is, with fore-mentioned recursive skeletons, how the learning process handles this, per learning objective and data preparation perspective.

1 comment

Response to Reviewer 1

Thank you for recognizing the value of the two-stage framework and the element-level reward. We address cross-format transfer, related work, and recursive skeletons below.

RL gains on HTML and PPTX

Our cross-format experiment was designed to test whether the proposed framework and RL training could transfer layout ability learned from SVG to other visual-code formats. We therefore deliberately excluded HTML, LaTeX, and PPTX from training. We agree that the 9B model does not show a consistent additional gain from SVG-only RL on HTML and PPTX, and we will make this limitation clearer in the paper.

At the same time, the results provide evidence that learned geometric layout behavior can transfer. In particular, Appendix A.7, Table 22 reports a controlled comparison on the 4B model: after RL, overlap decreases and the intent-level end-to-end layout measure improves relative to SFT in all three unseen formats, including HTML and PPTX. These results support our claim about improved layout planning, while the mixed results across model scales show that this transfer is not yet consistently reflected in final cross-format performance. We will further test this question by training with the target formats included and reporting whether format-specific or mixed-format RL improves their final delivery rates.

Comparison with related RL methods

Thank you for raising these related works. Their generation settings differ from ours in important ways. RLRF and RefineSVG primarily study image-conditioned SVG generation or refinement, while GeoSVG-RL focuses on structured technical diagrams. Our work addresses geometric layout errors in dense, content-bearing visual code across formats. We will make these task differences clearer in the revised paper.

AeSlides is the closest comparison for our reward ablation. It uses an elaborate set of scoring criteria to evaluate a completed slide and optimizes the resulting page-level outcome reward with a GRPO-family method. Our outcome-reward GRPO ablation follows the same approach at the level relevant to our contribution: it assigns one score to the completed output. The difference we aim to test is whether assigning geometric feedback to individual elements and their corresponding code spans improves on that page-level training signal. We will clarify this connection in the paper and add a direct comparison under a shared evaluation setting.

Recursive, multilayer skeletons

The current Stage 1 skeleton does not explicitly support recursively nested regions. Our schema and training data represent layouts primarily as a flat set of regions, without supervising parent–child skeleton relationships. Although generated code may occasionally contain nested structures, we have not trained or evaluated recursive skeleton generation as an explicit planning capability. We did not prioritize it because defining and validating recursive plans would add substantial complexity, while the layouts in our current evaluation can largely be expressed with the flat schema.

An extension would require a hierarchical schema, teacher trajectories containing nested plans, and a learning objective that supervises their generation. Its RL reward would also need to change. In our current flat setting, a pairwise geometric defect assigns equal responsibility to the elements involved. In a recursive layout, an error observed in a child may originate from the child’s placement, its parent’s geometry, or an earlier decision higher in the hierarchy. Assigning the same penalty to every element along that chain would therefore be inappropriate. A hierarchical reward may need to weight elements differently according to their level and role in the parent–child chain. Before defining those weights, we would need to examine how errors propagate across levels and which decisions can actually correct them. Our current RL update applies to code realization; directly optimizing decisions in a recursive Stage 1 plan would also require a planning-stage RL objective. We will clarify this extension and its open design questions without presenting it as a capability established by the current experiments.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.