From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation

Table of Links
Abstract and 1. Introduction

Background & Related Work
Method
3.1 Sampling Small Mutations
3.2 Policy
3.3 Value Network & Search
3.4 Architecture
Experiments
4.1 Environments
4.2 Baselines
4.3 Ablations
Conclusion, Acknowledgments and D…


This content originally appeared on HackerNoon and was authored by Photosynthesis Technology: It's not just for plants!

Abstract and 1. Introduction

  1. Background & Related Work

  2. Method

    3.1 Sampling Small Mutations

    3.2 Policy

    3.3 Value Network & Search

    3.4 Architecture

  3. Experiments

    4.1 Environments

    4.2 Baselines

    4.3 Ablations

  4. Conclusion, Acknowledgments and Disclosure of Funding, and References

    \

Appendix

A. Mutation Algorithm

B. Context-Free Grammars

C. Sketch Simulation

D. Complexity Filtering

E. Tree Path Algorithm

F. Implementation Details

C Sketch Simulation

As mentioned in the main text, we implement the CSG2D-Sketch environment, which is the same as CSG2D with a hand-drawn sketch observation model. We do this to primarily show how this sort of a generative model can possibly be applied to a real-world task, and that observations do not need to

\ Figure 11: Examples of thresholding scene images using the LZ4 compression algorithm. The left represents our test set, the right represents our training distribution.

\ be deterministic. Our sketch algorithm can be found in our codebase, and is based off the approach described in Wood et al. [39].

\ Our compiler uses Iceberg [16] and Google’s 2D Skia library to perform boolean operations on primitive paths. The resulting path consists of line and cubic bézier commands. We post-process these commands to generate sketches. For each command, we first add Gaussian noise to all points stated in those commands. For each line, we randomly pick a point near the 50% and 75% of the line, add Gaussian noise, and fit a Catmull-Rom spline [5]. For all curves, we sample random points at uniform intervals and fit Catmull-Rom splines. We have a special condition for circles, where we ensure that the start and end points are randomized to create the effect of the pen lifting off. Additionally we randomize the stroke thickness.

\ Figure 10 shows the same program rendered multiple times using our randomized sketch simulator.

\

:::info Authors:

(1) Shreyas Kapur, University of California, Berkeley (srkp@cs.berkeley.edu);

(2) Erik Jenner, University of California, Berkeley (jenner@cs.berkeley.edu);

(3) Stuart Russell, University of California, Berkeley (russell@cs.berkeley.edu).

:::


:::info This paper is available on arxiv under CC BY-SA 4.0 DEED license.

:::

\


This content originally appeared on HackerNoon and was authored by Photosynthesis Technology: It's not just for plants!


Print Share Comment Cite Upload Translate Updates
APA

Photosynthesis Technology: It's not just for plants! | Sciencx (2025-09-26T18:00:07+00:00) From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation. Retrieved from https://www.scien.cx/2025/09/26/from-program-to-sketch-modeling-non-deterministic-observations-in-code-generation/

MLA
" » From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation." Photosynthesis Technology: It's not just for plants! | Sciencx - Friday September 26, 2025, https://www.scien.cx/2025/09/26/from-program-to-sketch-modeling-non-deterministic-observations-in-code-generation/
HARVARD
Photosynthesis Technology: It's not just for plants! | Sciencx Friday September 26, 2025 » From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation., viewed ,<https://www.scien.cx/2025/09/26/from-program-to-sketch-modeling-non-deterministic-observations-in-code-generation/>
VANCOUVER
Photosynthesis Technology: It's not just for plants! | Sciencx - » From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/26/from-program-to-sketch-modeling-non-deterministic-observations-in-code-generation/
CHICAGO
" » From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation." Photosynthesis Technology: It's not just for plants! | Sciencx - Accessed . https://www.scien.cx/2025/09/26/from-program-to-sketch-modeling-non-deterministic-observations-in-code-generation/
IEEE
" » From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation." Photosynthesis Technology: It's not just for plants! | Sciencx [Online]. Available: https://www.scien.cx/2025/09/26/from-program-to-sketch-modeling-non-deterministic-observations-in-code-generation/. [Accessed: ]
rf:citation
» From Program to Sketch: Modeling Non-Deterministic Observations in Code Generation | Photosynthesis Technology: It's not just for plants! | Sciencx | https://www.scien.cx/2025/09/26/from-program-to-sketch-modeling-non-deterministic-observations-in-code-generation/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.