The Scene Language: Representing Scenes with Programs, Words, and Embeddings

## Abstract

Abstract We introduce the Scene Language, a visual scene representation that concisely and precisely describes the structure, semantics, and identity of visual scenes.
It represents a scene with three key components: a program that specifies the hierarchical and relational structure of entities in the scene, words in natural language that summarize the semantic class of each entity, and embeddings that capture the visual identity of each entity.
This representation can be inferred from pre-trained language models via a training-free inference technique, given text or image inputs.
The resulting scene can be rendered into images using traditional, neural, or hybrid graphics renderers.
Together, this forms a robust, automated system for high-quality 3D and 4D scene generation.
Compared with existing representations like scene graphs, our proposed Scene Language generates complex scenes with higher fidelity, while explicitly modeling the scene structures to enable precise control and editing.
Project page: https://ai.stanford.edu/~yzzhang/projects/scene-language/

## 1 Introduction

How do you describe a scene? Imagine that you just traveled to Easter Island and would like to explain to Alice the wondrous scene of Ahu Akivi: “There are seven moai in a row, facing the same direction.” “What is a moai?” Alice asked. “A moai is a stone human figure without legs, but each of them also looks slightly different.” At this point, you realize it seems difficult to precisely explain the scene using natural language alone.

In fact, this example highlights a complete scene representation requires at least three types of complementary information:
*structural knowledge*, which is about the joint distribution of multiple instances, like “seven moai in a row, facing the same direction,” most naturally described as programs;
*category-level semantics*, which may be shared across instances, often described in words, such as “moai”;
*instance-level intrinsics*, tied to the identity of each specific object or part, such as its geometry, color, and texture, which is hard to describe but easy to recognize.

Modern AI techniques provide natural grounding for each of the three modalities, while also falling short of capturing all:
in-context learning of pre-trained language models (LMs) enables the inference of domain-specific programs (Brown et al., );
LMs capture rich semantic information based on words in natural language;
embeddings obtained via techniques like textual inversion (Gal et al., ) or low-rank adaptation (Hu et al., ) best capture object identity.
However, none of these existing representations alone is sufficient for scene generation and editing.

We introduce the Scene Language, a representation that integrates the three modalities—programs, words, and embeddings—to precisely and concisely describe the structure, semantics, and identity of visual scenes.
In the Scene Language, a program specifies a computation process that defines the organization of a collection of *entities* in the scene, including extrinsics like poses and structural regularity like repetitions. Each entity is associated with a word referring to its semantic group, as well as an embedding describing its instance-specific attributes.

In addition to the representation itself, we propose a training-free inference module using a pre-trained LM as a backbone to infer the Scene Language from texts and images.
When provided with a domain-specific language (DSL) for scenes, LMs decompose the task of complex scene generation into simpler tasks of scene component generation by predicting their corresponding modular functions.
We also discuss possible neural, traditional, and hybrid graphics engines that render the representation to images. Together, the Scene Language, the inference module, and the renderer lead to a robust system for high-quality, detailed 3D and 4D scene generation and editing.

In summary, our contributions are as follows.

- 1.
A scene representation, the Scene Language, capturing structure, semantics, and identity of visual scenes using programs, words, and embeddings.
- 2.
A training-free method that infers the representation from texts and/or images using pre-trained language models.
- 3.
A generic rendering module that renders the Scene Language into an image.
- 4.
Empirical results on text- and image-conditioned scene generation and editing tasks.

Figure: Figure 1: Structured Scene Generation and Editing Using the Scene Language. We develop a scene representation for 3D scene generation and editing tasks. Given textual scene descriptions, the representation can be inferred by a pre-trained large language model, rendered in 3D, and edited following language instructions. The representation contains a program consisting of semantic-aware functions bound to words, providing high interpretability and an intuitive scene-editing interface, and embeddings enabling editing with fine controls, *e.g*., transferring the style of <z1*> from a user-input image to the generated scene by updating <z1> which controls global attributes of the scene.
Refer to caption: x1.png

## 2 Related Work

Visual scene representations are arguably the most fundamental problem in computer vision; thus, for sure, we may not enumerate all related work. As our Scene Language comprises programs, words, and embeddings, we will organize our discussion accordingly into three categories:
scene representations that use program-based representations (Section 2.1), semantic graph-based representations (Section 2.2), and a pre-trained generative model’s latent space (Section 2.3).

### 2.1 Representing Scenes as Programs

Programs can specify not only the relations among scene components mentioned in Section 2.2, but also structural patterns such as hierarchy and repetitions,
making them suitable as explicit descriptions of scene structures.
Prior works have proposed to use programs in the form of sequences of execution commands as object-centric representations, followed by neural executors that render the programs into 3D shapes (Tian et al., ; Sharma et al., ; Deng et al., ). In comparison, ShapeAssembly (Jones et al., ) introduces higher-level functions with semantically meaningful function names, *e.g*., “chair” and “back”, to its program representation. Both ShapeAssembly and ours adopt the design principle of function abstraction, which results in clearly stated hierarchy relation among components and better program editability. However, ShapeAssembly uses cuboids as the shape representation and does not model appearance, while ours allows for more precise geometry and appearance modeling using expressive neural embeddings.

All the representations mentioned above require 3D datasets for training. More recently, with the advance of language models (LMs), several methods (Zhou et al., ; Hu et al., ; Yamada et al., ; Sun et al., ; Zhang et al., ; Tam et al., ) have proposed to use zero-shot LM inference for generating programs that will be rendered into scenes. These methods operate on top of program syntax from specific graphics renderers such as Blender (Community, ), and they do not permit parameters in high-dimensional embedding spaces unlike ours.

### 2.2 Representing Scenes with Semantic Graphs

Prior semantic scene representations often adopt a graph to encode semantic scene components, such as objects and parts.
In particular, Yuille & Kersten (); Huang et al. () propose to employ a parse graph of context-free grammar, using terminal nodes to correspond to objects and their attributes, to represent a scene. Both works employ an analysis-by-synthesis approach to infer the representation from images that heavily rely on domain-specific priors.
Alternative representations include scene graph (Johnson et al., ; ; Gao et al., ), where each node in a graph corresponds to an object and an edge corresponds to a pairwise relation, and StructureNet (Mo et al., ), which focuses on an object-centric setting and uses nodes for object parts. While these representations preserve the high-level semantics of scenes or objects, they leave out low-level precision; thus, geometric, textural, or relational details that cannot be fully specified by language or hand-crafted rules are often ignored. We address this issue via the inclusion of embeddings.

### 2.3 Representing Scenes with Generative Model Latents

The latent space of visual generative models can serve as a representation space for visual scenes. Such latent space can effectively capture the exact visual content of scenes, including geometry and appearance details, and can be either directly inferred, *e.g*., in variational inference (Kingma, ) and model inversion (Zhu et al., ). More recently, text-to-image diffusion models have shown remarkable results in image synthesis. This class of models offers several candidate representation spaces including the space of textual embeddings (Gal et al., ), low-rank network weights (Hu et al., ), full model weights (Ruiz et al., ),
or noise vectors in the diffusion process (Song et al., ; Mokady et al., ; Ho et al., ).
However, such representations typically do not offer interpretable semantics or explicitly encode hierarchical scene structures unlike ours.

Figure: Figure 2: Scene Language Overview. A Scene Language represents a scene with three components: a program consisting of entity functions, a set of words (*e.g*., pawn) denoting the semantic class of the entity functions, and a list of embeddings (*e.g*., <z1>) capturing the identity of each entity in the scene. Each entity function is bound with an entity class name given by a word, and maps an input embedding to an output entity of that class. Executing the program effectively computes all entities; the computation graph is shown on the right. Entity dependency, as indicated by arrows, reflects the hierarchical relation of entities in a scene. See Section 3.1 for representation definitions and Section 3.2 for program syntax. The program shown is converted from our inference method output, with text prompt “a chessboard at game start”; raw outputs in Section F.1.
Refer to caption: x2.png

**Table 1: Summary of Notations in Sections 3.1 and 3.2.**
| Section 3.1 | Section 3.2 | Definition |
| --- | --- | --- |
| Expressions |  |  |
| $\Psi_{\text{transform}}$ | transform | Transform an entity |
| $\Psi_{\text{union}}$ | union | Compose entities |
| $f_{w}:z,\gamma\mapsto h$ | <entity-func> | Entity function mapping embeddings to entity |
| $f_{w}(z,\gamma)$ | (call <word > <embedding >*) | Entity function application |
| Data Types |  |  |
| $w$ | Word | Word describing semantics |
| $t$ | Matrix | Entity pose |
| $z$ | Embedding | Embedding specifying entity identity |
| $\gamma$ | List[Embedding ] | Embeddings specifying identities of descendent entities |
| $h$ | Entity | An entity |
| $s$ | Entity | The represented scene |

**Table 2: The Domain-Specific Language. The following table contains the DSL specification used to define our representation. Built-in data types (*e.g*., Float), functions (*e.g*., car and cdr), special forms (lambda), and conditionals (if) are omitted; <START> denotes program starts, ::= denotes rewriting rules; :: denotes type annotation; _:: denotes type annotation for an anonymous formal parameter, * denotes one or more expressions of the same type. The full DSL and explanations of the macros are deferred to Appendix B.**
| Data Types |  |
| --- | --- |
| Word | // Word specifying semantics |
| Embedding | // Embedding specifying an entity’s attributes |
| Matrix | ::= Array[Array[Float]] // Transformation in $\mathrm{GA}(3,\mathbb{R})$ |
| Entity | ::= Tuple[Tuple[Word, Embedding ], List[Tuple[Entity, Matrix]]] |
| Grammar |  |
| <START> | ::= <bind-expr>* |
| <bind-expr> | ::= (bind <word > <entity-func>) |
| <entity-func> | ::= (lambda (embedding::Embedding embedding-list::List[Embedding ]) |
|  | <sub-entities>) |
| <sub-entities> | ::= (union <entity-transform>*) |
|  | | (union-loop <loop-count> (lambda (i::Integer) <entity-transform>)) |
| <entity-transform> | ::= (transform <entity> <matrix>) |
| <entity> | ::= (call <word > <embedding>*) |
| <word > | :: Word |
| <entity-func> | :: Embedding -> List[Embedding ] -> Entity |
| <loop-count> | :: Integer |
| <matrix> | :: Matrix |
| <embedding > | :: Embedding |
| Macros |  |
| call | ::= (lambda (word . embedding-list) // Return an entity from the semantic class of word |
|  | (cons (cons word (car embedding-list)) |
|  | ((retrieve word) (car embedding-list) (cdr embedding-list)))) |
| union | ::= list // Compose transformed entities |
| union-loop | ::= (lambda (loop-count loop-func)  // Compose transformed entities using a for loop |
|  | (union (map loop-func (iota loop-count)))) |
| transform | ::= cons // Transform entity pose |
| Special Forms |  |
| (bind <word > <entity-func>) // Defines and binds an entity function |  |
| (retrieve <word >)  // Retrieves an entity function bound to word, or (lambda (_) (list)) if such function does not exist |  |

## 3 The Scene Language

We aim to design a visual scene representation that encodes the structure, semantics, and visual content of scenes.
Towards this goal, we propose the Scene Language, which represents a scene with three components: a program that encodes scene structure by specifying the existence and relations of scene components, which we will refer to as entities; words in natural language that denote the semantic group of each entity in the scene; and neural embeddings that pertain the low-level visual details and identities of the entities by permitting an expressive input parameter space.
In the following, we will first give a formal definition of the representation (Section 3.1), and then introduce a domain-specific language (DSL) (Section 3.2) as its realization.

### 3.1 Formal Definition

The Scene Language for a scene $s$, denoted as $\Phi(s)$, is formally defined as follows:

$$ $\Phi(s):=\left(W,P,Z\right).$ (1) $$

Here, $W$ is a collection of phrases in natural language, referred to as words, *e.g*., $W=\{\text{{\color[rgb]{0.08203125,0.375,0.51171875}board}},\text{{\color[rgb]{
0.08203125,0.375,0.51171875}pawn}},\cdots\}$ as illustrated in Fig. 2, and $P:=\{f_{w}\}_{w\in W}$ is a program consisting of a set of entity functions $f_{w}$ indexed by $w\in W$. Each entity function $f_{w}$ defines a class of entities in the scene; it is uniquely identified by the associated $w\in W$, which concisely summarizes the semantic meaning of the defined class.
Each of $f_{w}$ maps neural embeddings $(z,\gamma)$ to a specific entity $h$ in the scene, where $z$ specifies the attributes and identity of $h$,
like a specific color of a pawn, and $\gamma$ specifies identities of its sub-entities.
Hence, the complete Scene Language $\Phi(s)$ of a particular scene $s$ also contains an ordered set of neural embeddings $Z:=\left[z_{1},z_{2},\cdots,z_{J}\right]$ corresponding to the $J$ specific entities $\left[h_{1},h_{2},\cdots,h_{J}\right]$ from scene $s$, where $h_{j}\in J$ is computed by applying an entity function on inputs $z_{j}\in Z,\gamma_{j}\subset Z$.

Crucially, program $P$ captures scene structures in three aspects.
First, each entity function $f_{w}\in P$ transforms and composes multiple sub-entities (*e.g*., $64$ squares) into a new, more complex entity (*e.g*., a board), naturally reflecting the hierarchical, part-whole relations in the scene, as the arrows in Fig. 2 highlight.
Second, multiple entities $h_{j}$’s may belong to the same semantic class $w$ (*e.g*., square), and can thus be represented by reusing the same entity function $f_{w}$ with distinct embeddings $z_{j}$’s.
Finally, each entity function also captures the precise spatial layout of the sub-entities by specifying their relative poses during the composition, such as $64$ squares forming an $8\times 8$ grid.

In the following, we will expand on how functions from $P$ are defined, followed by the program execution procedure to compute the represented scene $s$.
Notations are summarized in Table 1.

#### Entity Function Definitions.

An entity function $f_{w}$ outputs an entity $h$ of semantic class $w$. The function $f_{w}$ takes two inputs: an embedding $z$ that specifies $h$’s identity, as well as an ordered set $\gamma$ containing embeddings of all descendent entities of $h$. Denote $\{h^{(i)}\}_{i=1}^{N}$ as the $N$ sub-entities of $h$, where $N$ is a constant determined by $f_{w}$. Then we have $\gamma=\left\{z^{(i)},\gamma^{(i)}\right\}_{i=1}^{N}$, where $z^{(i)}$ and $\gamma^{(i)}$ are the embeddings of $h^{(i)}$ and of the descendent entities of $h^{(i)}$, respectively. Thus, $f_{w}(z,\gamma)$ is recursively defined as

$$ $\displaystyle h$ $\displaystyle=f_{w}(z,\gamma):=\Psi_{\text{union}}\left(\left\{\Psi_{\text{ transform}}(h^{(i)},t^{(i)}(z))\right\}_{i=1}^{N}\right),$ (2) $\displaystyle\text{where}\;\;h^{(i)}$ $\displaystyle=f_{w^{(i)}}(z^{(i)},\gamma^{(i)})\;\;\text{is a sub-entity of $h $ and}\;\;t^{(i)}(z)\;\;\text{specifies its pose.}$ $$

Here, $f_{w}$ specifies the computation procedure to obtain output $h$ from $N$ sub-entities $\{h^{(i)}\}_{i=1}^{N}$ via two operations: $\Psi_{\text{transform}}$ applies an input-dependent pose $t^{(i)}(z)$ to a sub-entity $h^{(i)}$, transforming it from its canonical frame to the world frame of $h$, and $\Psi_{\text{union}}$ composes multiple sub-entities into one single entity.
Each sub-entity $h^{(i)}$ is computed by recursively applying an entity function $f_{w^{(i)}}$ also defined using Eq. 2.
For instance, let $f_{w}$ denote the entity function that produces the board in Fig. 2 (namely, $w=\text{{\color[rgb]{0.08203125,0.375,0.51171875}board}}$).
This function $f_{w}$ composes $64$ sub-entities $\{h^{(i)}\}_{i=1}^{64}$ of the same class square, which are in turn obtained by executing the *same* entity function $f_{w^{(i)}}=f_{\text{{\color[rgb]{0.08203125,0.375,0.51171875}square}}}$ with *different* embeddings $z^{(i)}$ and $\gamma^{(i)}$.

#### Program Execution.

To obtain a scene $s$ from the Scene Language $\Phi(s)=(W,P,Z)$, a program executor identifies a root entity function $f_{w_{1}}$ from $P$ that is not dependent by any other function (*e.g*., $w_{1}=\text{{\color[rgb]{0.08203125,0.375,0.51171875}chessboard}}$ from Fig. 2), and evaluates this root function using the first embedding $z_{1}\in Z$ and the rest as its descendants, $\gamma_{1}:=[z_{2},\cdots,z_{J}]\subset Z$, to obtain $s=f_{w_{1}}(z_{1},\gamma_{1})$.
Evaluating $f_{w_{1}}(z_{1},\gamma_{1})$ expands the computation recursively to its children functions $h_{j}=f_{w_{j}}(z_{j},\gamma_{j})$ as defined in Eq. 2, obtaining a full sequence of all the entities $h_{j}$ of the scene, where $j=1,2,\cdots,J,z_{j}\in Z,w_{j}\in W$. The order in $Z$ corresponds to the depth-first-search of the computation graph starting from $z_{1}$. An example computation graph is visualized on the right of Fig. 2.

### 3.2 The Scene Language as a Programming Language

We now concretize the definition in Section 3.1 with a domain-specific language (DSL) specified in Table 2.
To define entity functions in the DSL, we introduce macro operations union for $\Psi_{\text{union}}$, union-loop which calls union on entities evaluated in a for-loop, and transform for $\Psi_{\text{transform}}$.
We use these four macro operations and function calls of dependent functions to define entity functions.
Entity functions are identified with the associated words in the DSL via two special forms: bind, which binds an entity function $f_{w}$ to word $w$, and retrieve, which retrieves $f_{w}$ given $w$ and applies $f_{w}$ on actual embedding parameters. If $w$ is never bound to a function, it corresponds to an entity function with no sub-entities (*i.e*., $N=0$ in Eq. 2), in which case call returns a primitive entity with no children.

The data type of an entity $h$ (Eq. 2) is denoted as Entity. It stores two data fields Word and Embedding, describing the entity’s semantic group and identity respectively, and stores each children entity together with its pose in the frame of $h$.
In particular, Embedding captures the visual details and requires a highly expressive representation, *e.g*., neural embeddings. We employ the textual embedding space of OpenCLIP-ViT/H (Ilharco et al., ) for parameterization, denoted as $\mathcal{Z}_{\text{CLIP}}$. It offers the advantage that embeddings can be either encoded directly from natural language or inferred from images with Textual Inversion (Gal et al., ).
Table 1 summarizes the expressions and data types in accordance with the notations from Section 3.1.

Figure: Figure 3: Rendering. Given a Scene Language in (a), a program interpreter executes the program to obtain a data object in (b). A graphics renderer first reparameterizes the data object from (b) into the renderer-specific parameter space, and then executes the rendering operation $\mathcal{R}$ to obtain the final image output in (d).

**Table 3: Graphics Renderers Examples.**
| Renderer | Examples |  |  |
| --- | --- | --- | --- |
| Rendering Operation $\mathcal{R}$ | Parameters from $\Theta$ | $g_{\text{reparam}}$ |  |
| Primitive-based renderer | Light transport simulation | Shape and BRDF parameters | LM inference |
| Asset-based renderer | Ray tracing | Asset metadata | LM inference |
| SDS-based renderer | Gaussian splatting | 3D Gaussian parameters | SDS optimization |
| T2I model | Model feed-forward pass | Text embeddings in $\mathcal{Z}$ | CLIP text encoding |

## 4 Rendering

Applying the proposed scene representation to image generation tasks requires rendering a Scene Language $\Phi(s)$ into images.
To do so, first, the program interpreter evaluates $\Phi(s)$ to obtain a data object of type Entity.
Afterward, a graphics renderer maps the Entity data object to its rendering parameter space and renders it into a final image.

#### Renderer Specifications.

We define the specification of a graphics renderer, a module in the proposed representation, as follows. A graphics renderer is determined by
primitive parameter space $\Theta$
and a rendering operation $\mathcal{R}:\mathcal{P}\left(\Theta\times\mathcal{T}\right)\rightarrow\mathcal
{I}$,
where $\mathcal{T}$ is the space of 3D affine transformations representing poses, $\mathcal{P}$ denotes all possible subsets, and $\mathcal{I}$ is the space of rendered images.
In order to determine a mapping from program execution outputs of type Entity (Fig. 3b) to the admissible input domain of rendering operation $\mathcal{R}$ (Fig. 3c), we assume access to a reparameterization function $g_{\text{reparam}}$ that maps from Tuple[Word, Embedding ] to $\Theta$,
and compute a primitive’s pose $t\in\mathcal{T}$ by multiplying all Matrix values along the path from the primitive to the scene (root) in the entity hierarchy, analogous to computing limb poses in a kinematic tree.

#### Renderer Instantiations.

An example renderer instantiation is with
Score Distillation Sampling (SDS) (Poole et al., ) guidance, where $\Theta$ is a differentiable 3D representation, and we specify $g_{\text{reparam}}$ as follows.
Recall that an entity is associated with a Word value, *e.g*., moai for one statue from Figs. 1 and 3, and an Embedding value, *e.g*., <z2>.
For each primitive entity (*i.e*., an entity with no children), given these two value fields together with the fields of its ancestors, we use a manually specified language template $c$, or a <z2> moai, in the style of <z1>, 3D model in this example, to embed them into $z=g_{\text{CLIP}}(c)\in\mathcal{Z}_{\text{CLIP}}$ where $g_{\text{CLIP}}$ is the pre-trained CLIP text encoder.
Then, $g_{\text{reparam}}:\mathcal{Z}_{\text{CLIP}}\rightarrow\Theta$ corresponds to the SDS-guided optimization to find a solution in $\Theta$ that aligns with the input condition $z\in\mathcal{Z}_{\text{CLIP}}$. Output 3D scenes can be personalized by editing embeddings, *e.g*., <z1> which controls the global style in Fig. 1.

For the underlying 3D representation, we use 3D Gaussian Splatting (Kerbl et al., ) where images are rendered by splatting a set of 3D Gaussians onto the image plane; other differentiable 3D representations such as neural fields will also be suitable.
We base our implementation on GALA3D (Zhou et al., ), and use MVDream (Shi et al., ) and a depth-conditioned ControlNet (Zhang et al., ) for guidance.

We refer to the renderer above as the Gaussians renderer. Other possible renderers include primitive-based renderers, such as Mitsuba (Jakob et al., ) with graphics primitives of cubes, spheres, and cylinders; asset-based game engines, such as MineCraft (Mojang Studios, ); and feed-forward inference of layout-conditioned text-to-image (T2I) diffusion models, such as MIGC (Zhou et al., ), which achieves 2D bounding box conditioning by controlling attention layers from Stable Diffusion (Rombach et al., )). Table 3 shows a summary; details are in Appendix C.

Figure: Figure 4: Text-Conditioned Scene Generation. The bottom shows input texts. Ours produce more accurate outputs than using no intermediate representation (MVDream) or scene graph (GraphDreamer).
Refer to caption: x4.png

Figure: Figure 5: Scene Editing with Language Instructions. The program structure from our representation is highly interpretable, which benefits user editing. The bottom of each row shows initial scene descriptions and editing instructions in the format of user text prompts. We prompt an LM to infer the initial Scene Language as well as the edits (shown with texts in red), and show image renderings with two renderers.
Refer to caption: x5.png

## 5 Inference via Pre-trained Language Models

We introduce a training-free method to infer the representation $\Phi(s)=(W,P,Z)$ from text or image descriptions of a scene $s$. As explained below, we first prompt a pre-trained language model (LM) to generate the non-neural components ($W,P$) and then obtain neural embeddings ($Z$) from texts via the CLIP text encoder or from images with a pre-trained text-to-image diffusion model.

LMs have shown remarkable capability in code generation with common programming languages such as Python. In our implementation, we prompt LMs to generate Python scripts.
We prompt the LM with the input condition, *i.e*., a scene description in texts or an image; a Python script of helper functions converted from the DSL in Table 2; and an example script using the helper functions.
We use Claude 3.5 Sonnet (Anthropic, ) for all experiments for our method and LM-dependent baselines.
Full language prompts are listed in Appendix D.

Function arguments in the LM-generated scripts, which are numeric values or string tokens, are converted to embeddings from $\mathcal{Z}_{\text{CLIP}}$ (Section 3.2) using language templates and the CLIP text encoder $g_{\text{CLIP}}$.
For example, in the raw LM output, function calls for white pieces in Fig. 2 have input attribute {"color":(.9,.9,.9)}, and we prompt LM to describe the color value as a word, and feed the word into $g_{\text{CLIP}}$ to compute <z68>.
For image-conditioned tasks, for each primitive entity in the execution output of $P$, we first use GroundingSAM (Kirillov et al., ; Ren et al., ) to segment out the region defined by the word associated with the entity. We then use Textual Inversion (Gal et al., ) to optimize an embedding to reconstruct the cropped image with the diffusion model training objective. The full process is deferred to Section E.1.

## 6 Applications

We apply the method from Section 5 to the tasks of text-conditioned 3D scene generation (Section 6.1) and editing (Section 6.2), image-conditioned scene generation (Section 6.3), and 4D scene generation (Section 6.4).

### 6.1 Text-Conditioned Scene Generation

#### Baselines.

To evaluate the proposed representation, we compare our inference pipeline with 3D scene generation methods using alternative intermediate representations, *e.g*., scene graph. In particular, we compare with GraphDreamer (Gao et al., ) as an exemplar approach, which generates scene graphs from input texts via LM prompting and then synthesizes scenes conditioned on the graphs via SDS guidance.
We further ablate the role of structural representation in this task by comparing
ours with the backbone of our SDS-based renderer, MVDream (Shi et al., ), as a direct scene generation approach.
Full implementation details in Section E.2.

#### Results.

Text-conditioned scene generation results rendered with the SDS-based renderer are shown in Fig. 4. Compared to the direct 3D scene generation method MVDream, our approach is compositional and adheres more closely to input prompts in scenes involving multiple objects.
Compared to a scene graph representation, where entity relations are restricted to be between two objects and are bottlenecked by the coarseness of natural language descriptions, *e.g*., “aligned in a row”, a program-based representation offers more flexible and precise specifications for relations, *e.g*., the particular coke can arrangement in Fig. 4.
This brings the practical benefit of offloading the burden of generating scenes involving complex entity relations from the T2I model (used for SDS guidance in both ours and GraphDreamer) towards LM, leading to accurate and detailed generation results.

**Table 4: Quantitative Evaluation. We perform a user study to compare with prior methods on the text-conditioned 3D generation task and report the percentages of user preferences for prompt alignment. We also report the counting accuracy (0 0 for inaccurate and $1$ for accurate). Results are averaged across $9$ scene prompts and $103$ users; $\pm$ denotes standard deviation.**
| Methods | Alignment | Counting |
| --- | --- | --- |
| GraphDreamer | $3.56$$\pm 7.38$ | 0.11 |
| MVDream | $10.79$$\pm 12.83$ | 0.11 |
| Ours | 85.65$\pm\textbf{13.71}$ | 1.0 |

To quantitatively compare our method with baselines, we conduct a user study (Section E.3) where users are asked to choose one of the three animated scenes, synthesized by ours and two baselines in a randomized order, that aligns the best with the text prompt for the scene. We further report whether the synthesized scenes have the correct object count. As shown in Table 4, our method achieves a more favorable prompt alignment than the baselines and has a clear advantage in counting accuracy.

### 6.2 Text-Instructed Scene Editing

Scenes synthesized from our proposed representation can further be edited by prompting LM with its previously generated script and an editing instruction in natural language instruction.
Results are shown in Fig. 5.
Our representation provides an interpretable and intuitive interface for scene editing, as functions have explicit semantic meanings associated with words, and function reuse significantly improves program readability.
Furthermore, since the structure of programs reflects the structure of scenes, editing program parameters leads to changes in the scenes while preserving the original structure, *e.g*., the circular arrangement of staircases in Fig. 5. Desirable editing effects involving multiple primitives, or all staircases in this example, can be effectively achieved via only minor changes in the program space.
Finally, the program structure itself, such as the function header in the Jenga set example, can be adjusted for editing to achieve localized edits that only affect relevant parts of the scene.

Figure: Figure 6: Image-Conditioned Scene Generation. Both ours and GraphDreamer parse an input image to semantic entities. Programs from ours encode additional scene structure, *e.g*., repetitions, and specify geometric relations among entities more precisely. Embeddings from ours further enable visual identity preservation in the renderings.
Refer to caption: x6.png

The compositionality of our representation directly benefits localized scene editing. In comparison, MVDream from Section 6.1 does not apply to this task, as the entire scene is parameterized with a single 3D representation.
Precisely encoding the geometric relations of scene components further enhances the controllability of generated scenes. In comparison, GraphDreamer represents the binary relation of scene components with coarse language descriptions; therefore, it does not apply to editing tasks involving precise geometric controls, as shown in the first example from Fig. 5.

### 6.3 Image-Conditioned Scene Generation

The proposed representation can be used for image parsing and generating 3D scenes consistent with the parsed image structure and content.
We compare our representation with scene graphs by comparing our method with GraphDreamer as shown in Fig. 6.
Our representation explicitly encodes semantic components parsed from input images, high-level scene structures, such as the repetition of Coke cans, and visual details, such as the glass bottles with particular shapes and colors.
Our method preserves both structure and visual content from input images. In contrast, GraphDreamer only reconstructs semantics from input images; it leaves out entity poses and identities due to the information loss in the intermediate scene graph representation.

### 6.4 Text-Conditioned 4D Scene Generation

We apply the inference method from Section 5 to generate 4D scenes.
The 4D scene representation in this task is identical to the definition in Eq. 1, except that there is an additional 4D entity function in the program $P$.
The corresponding DSL extends from Table 2 as specified in Appendix B.

Allowing for a flexible set of primitive entities is crucial to make our representation suitable for generating 4D scenes of different scales, including objects with moving parts (*e.g*., the wind turbine from Fig. 8) and scenes with moving objects (*e.g*., the carousel). Specifically, primitives have granularity adapted to the particular scene being represented, instead of being chosen from a fixed set (Tian et al., ; Sharma et al., ) or object-centric as in scene graphs (Johnson et al., ).

Figure: Figure 7: Text-Conditioned 4D Scene Generation. The proposed representation may also capture scene dynamics and be applied for synthesizing 4D scenes. It explicitly represents the temporal correspondence of an entity in a dynamic scene. Each colored trajectory denotes tracking of a temporally moving point. See our project page for animations.
Refer to caption: x7.png

Moreover, the hierarchical scene structure encapsulated by our program-based representation makes it possible to represent 4D scenes compactly, serving as a regularization for generation output. Multiple entities, such as outputs from the function horse from the carousel scene in Fig. 8, can be grouped into one function horses and thereby share the same temporal transformation.
Writing composible functions for entity grouping effectively reduces the dimension of the temporal motion space and improves motion fidelity.
See the project page for better visualizations.

### 6.5 Different Graphics Renderers

Figure: Figure 9: Renderings Across Graphics Renderers. Different renderers produce renderings that adhere to the same representation and are therefore visually aligned, while each exhibits a different imaging style. Text inputs are shown at the bottom of the subfigures.
Refer to caption: x9.png

The same program can be rendered with different renderers described in Section 4, showing the versatility of the proposed representation. The results are shown in Fig. 9 with the same experiment setup as in Section 6.1.

### 6.6 Visualization of Discriminative Information

As shown in Fig. 8, several pieces of discriminative information can be directly obtained with the proposed Scene Language: semantic maps in Fig. 8b, as words represent per-entity semantics; instance segmentation in Fig. 8c, as the representation is compositional with separable instances; correspondence of the repeated instances in Fig. 8d, as programs specify repetitions existing in a scene; dense temporal correspondence for 4D scenes, as shown in Fig. 8.

## 7 Conclusion

We have introduced a visual scene representation, termed the Scene Language, which encodes three key aspects of visual scenes: scene structure, such as hierarchy and repetition, specified via programs; semantics of individual components succinctly summarized via words; and identities of each component precisely captured via neural embeddings.
We formalize the representation as a programming language defined using a DSL.
We show that the Scene Language can be efficiently inferred from both text and image inputs using pre-trained language models.
Once the program is executed, the resulting scene can be rendered into images using a variety of graphics renderers.
Compared with existing methods, our Scene Language produces 3D and 4D scenes with significantly higher fidelity, preserves complex scene structures, and enables easy and precise editing.

## Appendix A Overview

The supplementary contains the details for the representation definition (Appendix B), graphics renderers (Appendix C), and experiments (Appendix E).
Please refer to main text to see how they are integrated.

## Appendix B Domain-Specific Language

The complete DSL includes the ones listed in Table 2, with additional macros for computing transformation matrices as listed in Table 5, and grammar for 4D scenes as listed in Table 6.

We explain the four macros form Table 2 as follows. Their type annotations are listed in Table 5.

- •
Macro call retrieves the <entity-func> bound to the input word, applies the function on the input embeddings, and outputs a data object of type Entity. Specifically, (car embedding-list) is the embedding of the output entity corresponding to $z$ from Eq. 2, and (cdr embedding-list) is the list of embeddings of its descendent entities corresponding to $\gamma$.
- •
Macro union composes transformed entities by aggregating inputs into a list.
- •
Macro union-loop applies union in a for loop.
- •
Macro transform pairs an entity with its pose.

**Table 5: The Domain-Specific Language includes the definitions from Table 2 and the transformation-related macros from this table.**
| Data Types |  |
| --- | --- |
| Vector | ::= Array[Float] // Vector in $\mathbb{R}^{3}$ |
| Macros |  |
| call | :: Word -> List[Embedding ] -> Entity |
| union | :: (Tuple[Entity, Matrix])* -> List[Tuple[Entity, Matrix]] |
| union-loop | :: Int -> (Int -> Tuple[Entity, Matrix]) |
|  | -> List[Tuple[Entity, Matrix]]] |
| transform | :: Entity -> Matrix -> Tuple[Entity, Matrix] |
| translate | :: Vector -> Matrix  // Compute translation matrix |
| rotate | :: Float -> Vector -> Vector -> Matrix  // Compute rotation matrix |
| scale | :: Vector -> Vector -> Matrix // Compute scaling matrix |
| reflect | :: Vector -> Vector -> Matrix // Compute reflection matrix |
| @ | :: Matrix -> Matrix -> Matrix  // Matrix multiplication |
| compute-shape-center | :: Entity -> Vector // Compute center of an entity’s bounding box |
| compute-shape-min | :: Entity -> Vector // Compute minimum corner of an entity’s bounding box |
| compute-shape-max | :: Entity -> Vector  // Compute maximum corner of an entity’s bounding box |
| compute-shape-sizes | :: Entity -> Vector // Compute sizes of an entity’s bounding box |

**Table 6: The Domain-Specific Language for 4D scenes. * indicates one or more expressions.**
| Grammar |  |
| --- | --- |
| 4D-entity-func | ::= (lambda () create-entity-list)  // Define a function that outputs a 4D scene |
| create-entity-list | ::= (list create-entity*)  // Represent a 4D scene as a temporal list of entities |

## Appendix C Details of Graphics Renderers

This section expands the instantiation of three graphics renderers from Section 4 in detail. For each rendere, we will discuss its parameter space $\Theta$ and $\mathcal{T}$, renderer $\mathcal{R}$, and the reparameterization function $g_{\text{reparam}}$.

### C.1 SDS-Based Renderer

#### Parameter Space with 3D Gaussians.

For this renderer, $\Theta$ is the space of 3D Gaussian parameters and $\mathcal{T}$ is the space of 3D affine transformation matrices.
In particular, each primitive is parameterized as a set of $K$ 3D Gaussians under a 3D affine transformation $t$, written as $(\theta,t)=(K,\{\phi_{i}\}_{i=1}^{K},t)\in\Theta\times\mathcal{T}$, where $\phi_{i}$ is the set of parameters for a single 3D Gaussian, and $t$ is a 3D transformation matrix.
Each Gaussian parameter $\phi$ is defined as $\phi:=(\mu,\alpha,s,q,c)$, denoting the 3D center position, opacity, scale, rotation in quaternion, and color of the Gaussian, respectively.
An entity consisting of $N$ primitives is parameterized as $\{(\theta_{j},t_{j})\}_{j=1}^{N}=\{(K_{j},\{\phi_{i}^{j}\}_{i=1}^{K_{j}},t_{j}
)\}_{j=1}^{N}$.

#### Differentiable Rendering.

The rendering operation $\mathcal{R}$ for the 3D Gaussian renderer is as follows.

Following Kerbl et al. (), a single Gaussian is defined by

$$ $G(x)=e^{-\frac{1}{2}(x-\mu)^{T}\Sigma^{-1}(x-\mu)},$ $$

where $x\in\mathbb{R}^{3}$ is a point in world coordinate, $\Sigma:=(RS)(RS)^{T}$ the 3D covariance matrix, $R$ the rotation matrix computed from $q$, and $S$ the scaling matrix computed from $s$.

A Gaussian under transformation $t\in\mathcal{T}$ with $t(x)={R_{t}}{S_{t}}x+p_{t}$, where $R_{t},S_{t},p_{t}$ are the rotation, scaling, and translation components, respectively, is then computed with $G_{t}$ satisfying the follows:

$$ $G_{t}(t(x))=G(x).$ $$

We assume that diagonal entries of the scaling matrix $S_{t}$ are all positive, and therefore $t$ is invertible.
Combining the above gives

$$ $G_{t}(x)=e^{-\frac{1}{2}(x-\mu_{t})^{T}\Sigma_{t}^{-1}(x-\mu_{t})},$ $$

where $\mu_{t}=t(\mu)$ and $\Sigma_{t}=((R_{t}R)(S_{t}S))((R_{t}R)(S_{t}S))^{T}$.
Let $\tilde{t}(\phi)$ be the Gaussian after applying transformation $t$ on $\phi$. Then $\tilde{t}(\phi)$ has center $\mu_{t}$, rotation $R_{t}R$, scale $S_{t}S$, and has $\alpha$ and $c$ remaining unchanged as derived above.

The rendering operation $\mathcal{R}$ to convert an entity consisting of $N$ primitives, $\{(\theta_{j},t_{j})\}_{j=1}^{N}=\{(K_{j},\{\phi_{i}^{j}\}_{i=1}^{K_{j}},t_{j}
)\}_{j=1}^{N}$,
to the image space simply amounts to rendering all post-transformation 3D Gaussians in the scene, $\{\tilde{t}_{j}(\theta_{j})\}_{j}:=\{\tilde{t}_{j}(\phi_{i})\}_{i,j}$, following the projection and blending process from Kerbl et al. ().

#### Primitive Reparameterization via SDS Guidance.

Recall that $g_{\text{reparam}}$ aims to obtain 3D Gaussian primitive parameters for per-primitive conditional embeddings $\{z_{j}\}_{j=1}^{N}$ and global condition $z_{\text{global}}$, where $z_{j}=g_{\text{CLIP}}(c_{j})$ is explained in Section 4, and $z_{\text{global}}=g_{\text{CLIP}}(c_{\text{global}})$ is computed from a global scene description in texts, $c_{\text{global}}$.
We now expand Section 4 to describe the optimization process of $g_{\text{reparam}}$ in detail.

We write the SDS objective originally proposed in Poole et al. () as follows:

$$ $g(\psi;z,\hat{\epsilon}):=\nabla_{\psi}\mathcal{L}_{\text{SDS}}(x=\mathcal{R}( \psi);z,\hat{\epsilon})=\mathbb{E}_{\eta\sim\mathcal{U}(0,1),\epsilon\sim \mathcal{N}(0,I)}\left[w(\eta)(\hat{\epsilon}(\alpha_{\eta}x+\alpha_{\eta} \epsilon,z,\eta)-\epsilon)\frac{\partial x}{\partial\psi}\right],$ $$

where $\hat{\epsilon}$ is a pre-trained image denoising network, $\eta$ is diffusion timestep, and $w(\cdot),\alpha_{\eta}$ come from diffusion schedule.

With the notations from above, for entity $\{(\theta_{j},t_{j})\}_{j=1}^{N}$, let

$$ $\displaystyle\mathcal{L}(\{z_{j}\}_{j},z_{\text{global}},\{t_{\text{init},j}\} _{j}):=$ $\displaystyle\mathcal{L}_{\text{SDS}}(\{\tilde{t}_{j}(\theta_{j})\}_{j};z_{ \text{global}},\hat{\epsilon}_{\text{ControlNet}})+\sum_{j}\mathcal{L}_{\text{ SDS}}(\theta_{j};z_{j},\hat{\epsilon}_{\text{MVDream}})$ $\displaystyle+\sum_{j}\mathcal{L}_{\text{reg}}(\theta_{j},\text{StopGrad}(t_{j }))+\sum_{j}\mathcal{L}_{\text{layout}}(\theta_{j},t_{\text{init},j}),$ $$

where $\mathcal{L}_{\text{reg}},\mathcal{L}_{\text{layout}}$ are regularization terms following the definition from Zhou et al. () and StopGrad stops gradients from backpropagation.
Here, $\mathcal{L}_{\text{reg}}$ penalizes Gaussian ellipsoids that are too long, and $\mathcal{L}_{\text{layout}}$ penalizes Gaussians that lie outside the intial bounding box specified by $t_{\text{init}}$.

Finally, we have

$$ $g_{\text{reparam}}=\arg\min_{\{(\theta_{j},t_{j})\}_{j=1}^{N}}\mathcal{L}.$ $$

During optimization, if primitives $j_{1}$ and $j_{2}$ have the same condition and initial normalized bounding box scale, *i.e*., ($z_{j_{1}}=z_{j_{2}})\wedge(\frac{S_{t_{j_{1}}}}{\|S_{t_{j_{1}}}\|_{2}}=\frac{S
_{t_{j_{2}}}}{\|S_{t_{j_{2}}}\|_{2}})$, they are enforced to have the same parameters $\theta$ (but still distinct $t_{j_{1}}$ and $t_{j_{2}}$), which greatly reduces the number of parameters in the solution space.

In practice, for certain scenes, LM outputs treat detailed object parts as primitives, *e.g*., the hat rim and hat top from the first example in Fig. 5, and the backbone model for SDS guidance cannot effectively model such fine-grained parts. Therefore, we treat the hat as a primitive, whose pose is computed from the minimum bounding box containing both the hat rim and hat top, before carrying out the above optimization.
This process effectively adapts the granularity of the computation graph, originally specified in LM inference outputs, to the graphics renderer being used, by assigning intermediate nodes from the original computation graph as the new leaf nodes.

### C.2 Mitsuba Renderer

#### Parameter Space.

For this renderer, $\Theta$ is the parameter space for three types of graphics primitives supported by Mitsuba: cube, sphere, and cylinder, as specified in the function header for primitive_call in Section D.1. $\mathcal{T}$ is the 3D affine transformation space.

#### Renderer.

We use the path tracer with maximum depth 8 implemented in Mitsuba.

#### Reparameterization.

Since we directly prompt LM to generate Mitsuba primitive parameters in its outputs as specified in Section D.1, the function parameters from raw LM outputs are already in the parameter space $\Theta$ and are directly used for rendering, instead of being encoded into CLIP embeddings $z\in\mathcal{Z}_{\text{CLIP}}$.

### C.3 Minecraft Renderer

#### Parameter Space.

For this renderer, $\Theta$ is the asset parameters for Mincraft blocks, and $\mathcal{T}$ is the space of 3D similarity transformation matrices, *i.e*., of scaling and translation transformations. Note that we prevent rotation transformations in Minecraft, since that could lead to shapes that are impossible to render correctly in Minecraft.

Specifically, $\Theta$ is specified in the docstring from Section D.4 and is expanded below.
We introduce two types of primitives that let us construct in-game elements.

The first is set_cuboid. This primitive facilitates the creation of a cuboid within the Minecraft environment. The function accepts three arguments: (1) A string denoting the Minecraft block type (*e.g*., "minecraft:white_concrete"); (2) A tuple of three integers representing the scaling along the x, y, and z axes; (3) A boolean flag, fill, that specifies whether the cuboid should be solid or hollow.
The cuboid is anchored at the coordinate origin $(0,0,0)$, which corresponds to its front-left-bottom vertex.

The second is delete_blocks. This primitive allows for the deletion of a previously placed cuboid. It accepts a single parameter, which is a tuple of three integers denoting the scaling along the x, y, and z axes.
This operation removes the cuboid with its front-left-bottom vertex at the origin $(0,0,0)$, effectively clearing the designated space.

Note that we do not provide the Minecraft block type in the prompt, but instead let the model choose this parameter. Since there is a large amount of Minecraft data files on the web, the model performs decently well in choosing appropriate Minecraft blocks. We also augment this by building safety checks; for example, if the model chooses a Minecraft block that doesn’t exist in our version of Minecraft, we will use semantic similarity to choose the most similar block from our library.

We also are able to translate easily from Minecraft renderings to Mitsuba renderings, by converting Minecraft blocks to corresponding cuboids in Mitsuba. We also color the Mitsuba blocks accordingly to the average color of the Minecraft block.

#### Renderer.

We use WebGL(^1^11https://get.webgl.org/) and Deepslate(^2^22https://misode.github.io/deepslate/) for rendering Minecraft builds.

#### Reparameterization.

Similar to Mitsuba, function parameters from LM-generated programs are directly used for rendering without CLIP encoding or parameterization.

### C.4 Text-to-Image (T2I) Model Renderer

#### Parameter Space.

We employ MIGC (Zhou et al., ) as the backbone model for this renderer, which originally uses a CLIP text encoder (Radford et al., ) and a pre-trained UNet from Stable Diffusion (Rombach et al., ) for layout-conditioned text-to-image generation. The parameter space $\Theta$ for this renderer is the CLIP text embedding space.

#### Renderer.

We first project the 3D bounding boxes of primitives from an execution output of our representation to a 2D layout under a specified camera viewpoint, and then run the forward pass of the T2I model conditioned on the 2D layout, where each 2D bounding box corresponds to an aforementioned CLIP embedding $\theta\in\Theta$ .

#### Reparameterization.

Function parameters from LM-generated programs are directly encoded by the CLIP text encoder using the language templates described in Section 5.

## Appendix D Language Model Prompts

### D.1 Text- and Image-Conditioned Scene Generation

In Section 5, we introduced an inference method for the representation by prompting LMs.
The full system prompt is displayed below. The system prompt defines the data types and the function headers of macros from the DSL, written in Python.
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/system_prompt.md

The full user prompt for image or text-conditioned 3D generation is displayed below. It includes an example valid program, and the task specification indicated with a placeholder {task}.
For text-conditioned generation (Section 6.1), it is replaced with the input textual scene description.
For image-conditioned generation (Section 6.3), it is replaced with "Reconstruct the input scene", and the input image is also fed into LM.
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/user_prompt.md

### D.2 Scene Editing

For scene editing (Section 6.2), we prompt the LM in two rounds, first with a textual scene description with the same protocol from Section 6.1, and then with an editing instruction, *e.g*., "move the apple to the left". In the second round, the system prompt remains the same as Section D.1. The user prompt is as follows, where {program} is the LM output from first round, and {task} is the editing instruction.

[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/user_prompt_edit.md

### D.3 4D Generation

For 4D generation, we include one more macro definition in the system prompt as shown below. The remaining system prompt is the same as above.
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/system_prompt_4d.md

The full user prompt for 4D generation is displayed below.

[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/user_prompt_4d.md

### D.4 Minecraft Rendering

To prompt LM to generate Minecraft-compatible outputs, we remove rotation_matrix and reflection_matrix from the system prompt in Section D.1 and change the function header for primitive_call to the follows:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/system_prompt_minecraft.md

And we change the example program for user prompt accordingly to the follows:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/user_prompt_minecraft.md

## Appendix E Experiment Details

### E.1 Textual Inversion Optimization

To obtain image-conditioned embedding, we follow the procedure proposed in Gal et al. (). For the input image $I$ and text prompt $c_{j}$, we first use $c_{j}$ as guidance of GroundingSAM to obtain the desired mask of the corresponding entity. The cropped region is pad to square and resized to desired resolution, resulting in image target $I_{j}$. The background of $I_{j}$ is set to random grayscale color as used in Shi et al. ().

We adopt the language template "<class>, 3d model, in the style of <style>" in all the textual inversion experiments. The template is first converted into token embeddings, then using CLIP text-encoder $g_{\text{CLIP}}$ to transform to embeddings $z_{j}$ for diffusion model $\hat{\epsilon}_{\text{MVDream}}$. In each textual-inversion iteration, we optimize the token embeddings $v_{j1},v_{j2}$ for <class> and <style> while freezing others. We use the similar objective as in diffusion model training:

$$ $v_{j1}^{*},v_{j2}^{*}=\operatorname*{arg\,min}_{v_{j1},v_{j2}}\mathbb{E}_{\eta \sim\mathcal{U}(0,1),\epsilon\sim\mathcal{N}(0,1)}\Big{[}\|\epsilon-\hat{ \epsilon}_{\text{MVDream}}(\alpha_{\eta}I_{j}+\alpha_{\eta}\epsilon,\eta,z_{j} (v_{j1},v_{j2}))\|_{2}^{2}\Big{]}.$ $$

For each entity, we optimize the corresponding embeddings for $100$ iterations with learning rate $1$e-$2$. Empirically we find this setting is enough to fit the image conditions. After textual inversion, the embedding $z_{j}$ is computed with optimized token embeddings, and used to guide the entity optimization as explaint in Appendix C.

### E.2 GraphDreamer Implementation

Since the original paper didn’t release the script for automatic scene graph generation, we follow the descriptions in the paper and re-implement this stage to query LM to output scene graphs in json format to avoid manually converting LM outputs to model configurations.
The full system prompt is shown below:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/system_prompt_graphdreamer.md

The full user prompt is shown below, where the given example input and output are taken from the teaser figure of the original paper (Gao et al., ).
In below, {task} is a placeholder for input text prompts of scenes.
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/user_prompt_graphdreamer.md

After generating scene graphs with aforementioned prompt, we follow the released implementation to run Graphdreamer optimization. Each object in nodes list is represented as an individual object SDF and color field, and adopts Instant-NGP (Müller et al., ) as the backbone. The SDS loss optimizes not only each object, but also object pairs described in edges list. Note that Graphdreamer didn’t explicitly model the repetition of objects when dealing with scenes containing repetitive components. As a result, when the raw scene graph output contains too many objects, we’ll rerun the graph generation and add ”The maximum number of objects is three.” in text prompt to avoid reaching memory limitation during optimization.

### E.3 User Study Details

The user study is conducted on Prolific(^3^33[https://www.prolific.com/](https://www.prolific.com/)) with $103$ users.
We provide the following instruction in the user study:
“In the following questions, you’ll be provided a list of text descriptions and corresponding three generation results. Please choose the one that has best text-alignment, taking into account both the visual quality and the adherence to the layout structure outlined in the text prompt.”
For each of the $9$ scenes being evaluated, we ask the user to choose one of the three video rendering results, generated by our method and two baselines in randomized order. All videos shown in the user study are displayed on the project page.

## Appendix F Language Model Outputs

### F.1 Text-Conditioned 3D Generation

#### Example 1.

This example corresponds to Fig. 1.

Input: "Moai in Ahu Akivi, with slight variations".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/moai.txt

#### Example 2.

This example corresponds to Fig. 2.

Input: "a chessboard at game start".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/chessboard.txt

### F.2 Text-Conditioned 3D Editing

In this task, for each example, we prompt LM in two rounds—the first round with a scene description as task specification, and the second round with editing instructions. LM outputs in the first round are omitted.

#### Example 1.

Input scene description: "Rene Magritte The Son of Man".
Input editing instruction: "move the apple to the left".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/edited/apple-man.txt

#### Example 2.

Input scene description: "Paul Klee Castle and Sun".
Input editing instruction: "change all castles to be the middle one".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/edited/castle.txt

#### Example 3.

Input scene description: "Bramante Staircase, Vatican Museums".
Input editing instruction: "shrink staircase radius by 80%".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/edited/staircase.txt

#### Example 4.

Input scene description: "a 8-layer 3-color Jenga set at game start".
Input editing instruction: "remove 2 blocks from second top layer and the tower should not fall".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/edited/jenga.txt

#### Example 5.

Input scene description: "a fractal tree-like structure".
Input editing instruction: "make branching structure to be trinary and 3D".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/edited/fractal.txt

### F.3 Text-Conditioned 4D Generation

#### Example 1.

Input: "carousel with a small canopy".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/carousel.txt

#### Example 2.

Input: "solar system model".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/solar.txt

#### Example 3.

Input: "a toy wind turbine".

Output:
{mdframed}[backgroundcolor=gray!10,linewidth=0pt]
\inputmintedmarkdownprograms/outputs/wind.txt

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: Refer to weaknesses.
soundness: 3
strengths: The value of accurate coding is self-evident. The performance in tasks is remarkable and addresses issues where traditional language instructions are difficult to follow effectively.
summary: This paper utilizes the formal structure of the LISP language to define scenarios, allowing for precise expression of scenes and benefiting tasks such as generation and editing.
weaknesses: - However, overly precise definitions can significantly reduce flexibility. For example, "a child with golden hair is gazing out the window from the desk" is a very common and simple description in traditional language, but defining it using LISP is extremely challenging. Although embedding methods exist, I doubt whether this would completely degrade into pure embeddings, failing to effectively leverage the advantages of formal languages.

- The downside of using a LISP-like language for definitions is the extremely long textual information. This not only significantly increases memory consumption but also makes training more difficult. While the article uses a very clever method to circumvent this issue, it could lead to difficulties in subsequent work.

- Direct comparisons with previous work are unfair because this article is more akin to a combination of 3D assets, while previous work involves direct generation. The former relies on the latter. Essentially, they are different tasks, so a fair comparison should be: GPT-4 or a rule-based model directly decomposing prompts and generating combinations.

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 3
questions: 1. Regarding the image-to-scene task, since the LLM is already employed to describe the objects in the scene in order to prompt SAM, the textual-inversion step seems unnecessary or at the least deserving of an ablation study. Have the authors evaluated its effectiveness over using only LLM descriptions?
2. The Gaussians and Minecraft lecture-hall samples in Figure 9 seem to have very similar layouts. This is confusing given that the renderers require different scene-generation prompts ("To prompt LM to generate Minecraft-compatible outputs, we remove rotation matrix and reflection matrix from the system prompt in Appendix E.1 and change the function header for primitive call to the follows:") and so must be the results of distinct LLM calls. Do the authors have intuition as to why the layouts appear so similar? How much layout variability is observed between successive calls?
3. Is any differentiable rendering done with Mitsuba? It appears to be employed only as a generic physically based renderer and it's unclear why it was chosen over a more standard graphics engine.

Addl. Comments:
1. The use of Lisp-like syntax in Figure 2 is confusing as the authors "prompt LMs to generate a Python program." The authors should consider using the actual syntax throughout to improve clarity.
2. The "chessboard at game start" is incorrectly configured as the queens are not on their color.
3. The staircase code edit in Figure 5 displays the wrong values.
soundness: 3
strengths: 1. The paper is well-written.
2. The pipeline outputs are visually appealing and appear generally well-aligned with the prompt texts.
3. The task is interesting and relevant to the ICLR community.
summary: The authors propose "Scene Language," a pipeline for producing -- and later rendering -- a compositional scene representation from a text prompt or image. In contrast with GraphDreamer, which is compared against as an "exemplar approach," the authors task a language model with generating a precise, text-based code representation to define scene layout. The authors experiment with the application of multiple "rendering modules" to realize the code-based representations into explicit scenes, requiring only minor prompting modifications. To evaluate their method, the authors conduct a perceptual study measuring prompt alignment and counting accuracy.
weaknesses: 1. The authors make several unsupported claims, detailed below:

    a. "In summary, our contributions are as follows... Empirical results on text- and image-conditioned scene generation and editing tasks." Neither image-conditioned scene generation nor editing were empirically evaluated. The only such evaluation involved text-conditioned scene generation: "We perform a user study to compare with prior methods on the text-conditioned 3D generation task and report the percentages of user preferences for prompt alignment."

    b. "Compared with existing methods, our Scene Language produces 3D and 4D scenes with significantly higher fidelity, preserves complex scene structures, and enables easy and precise editing." 4D generation was not included in any evaluations or method comparisons.

    c. "Together, this forms a robust, fully automated system for high-quality 3D and 4D scene generation." The authors neither evaluate pipeline robustness nor include any discussion of it. 
2. The authors' choice of evaluations raises concerns:

    a. Rather than evaluate their pipeline on an existing setting, the authors opt to pick their own evaluation set of nine prompts, each of which includes a number ("8-layer", "5x5", "four", etc.). On this set, the authors measure "counting accuracy (0 for inaccurate and 1 for accurate)". They "compare with GraphDreamer (Gao et al., 2024) as an exemplar approach," but note that when the GraphDreamer "raw scene graph output contains too many objects, (they) rerun the graph generation and add 'The maximum number of objects is three.' in text prompt to avoid reaching memory limitation during optimization." This casts doubt on the significance of the results. Is the proposed method generally applicable, or does it only excel in counting-related scenarios with four or more objects?

    b. The authors display an image-to-scene comparison with GraphDreamer in Figure 6 and remark "Compared with our method, which preserves both structure and visual content from input images, GraphDreamer only reconstructs semantics from input images and leaves out entity poses and identities, due to the information loss in the intermediate scene graph representation." However, it is not clear why GraphDreamer (which is inherently semantic) was chosen for this comparison when the authors could have evaluated against a monocular reconstruction method.
3. The authors prominently feature the use of embeddings as a contribution of their work. However, except for serving as UUIDs, they seem only to be meaningfully employed in the image-to-scene task where a segmentation model is used to localize regions to apply textual inversion to. The authors' characterization of the embeddings as describing "the attributes and identity of the output entity, like a specific color of a 'pawn'." is an interesting idea but does not appear to align with their use in the paper: the black-and-white chess pieces clearly do not share shapes. It does not seem as though the authors have taken the idea far enough, and as it stands, could be removed from the pipeline to no discernible effect.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: Providing feedback on questions discussed in the weaknesses will be helpful.
soundness: 2
strengths: The paper is well-written, with a clear motivation and a thorough description of the proposed method. The application of scene editing is an important problem, highlighting the practical importance of the approach.
summary: The research paper introduces a new scene language representation designed to provide detailed information about a scene. This representation operates on three levels: programs that define the scene's composition and structural relationships between objects in the scene, semantic words that provide objects present in the scenes, and feature embeddings that capture instance-specific properties. These different layers provide a framework to describe a scene completely. They use this representation for scene generation and editing during rendering.
weaknesses: 1) The examples presented in the paper seem relatively simple. Including more realistic, real-world scenes could better demonstrate the effectiveness of the scene language representation in handling complexity. For instance, incorporating indoor or outdoor scenes with multiple objects and occlusions would provide a valuable setup to showcase the approach’s robustness and highlight its results in more challenging conditions.
2) Quantifying the correctness or accuracy of the scene language generation step would add valuable insight. Specifically, it would be beneficial to measure various aspects of the scene language generation process, as outlined in Section 5. 

3) It would also be valuable to demonstrate how noise and errors in the scene language are managed during generation. For instance, if the scene language contains inaccuracies, such as incorrect or impossible relationships between objects, it would be useful to illustrate how these issues are addressed to ensure coherent generation results.

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 3
questions: See details in the weaknesses.
soundness: 2
strengths: 1 The proposed method is applicable to multiple downstream scene generation/editing tasks. It is a training-free approach with the capability to generate and edit 3D and 4D scenes.

2 The visualization results show the superiority of the proposed method over competitors.

3 The paper is well-written with figures and tables nicely presented.
summary: The paper proposes a visual scene representation paradigm named Scene Language, which involves an ensemble of programs, words, and embeddings to describe the structure, semantics, and identity of visual scenes. A training-free inference technique is developed to infer the proposed scene representation from pre-trained language models. And a generic rendering module is utilized to render the scene into images using traditional, neural, or hybrid graphics renderers. Experimental results show that the proposed Scene Language generates complex scenes with higher fidelity while explicitly modeling the scene structures to enable precise control and editing.
weaknesses: 1 My biggest concern is that the manuscript seems to have incremental novelty since the proposed method relies on most existing models/tools and uses them straightforwardly. For example, the proposed scene representation is constructed directly using pretrained language models and is used for scene rendering using the existing rendering methods, e.g., 3D Gaussians.

2 Moreover, the proposed Scene Language looks more like an engineering improvement on GraphDreamer, breaking down complex scenes into independent entities for generation. The newly introduced embedding term also appears to have little effect. For example, in Figure 1, the referenced object should be made of metal material, while the modified object only captures information of blue color.

3 The pretrained language models are usually not ready for addressing specific downstream tasks and may produce inaccurate answers. However, the proposed method does not seem to incorporate some adaptation modules and give deep analysis.

4 The experiments also incorporate insufficient comparisons: (1) The authors should also report the FLOPs over the GraphDreamer for comprehensive comparisons. (2) If the provided image cannot describe the entire scene (e.g., occlusion), Scene Language cannot program the entire scene. Thus the comparisons to image-to-3D approaches should be included. (3) This paper lacks the ablation study on the proposal terms of descriptions on scene.