Under Review

DiffusionPack: Offline Bin Packing with Custom Human Preferences

Anonymous Affiliation · Anonymous Email

Abstract

The three-dimensional bin packing problem (3D-BPP) is fundamental in robotic palletizing and warehouse automation, where systems must generate compact, feasible layouts that also satisfy user-defined requirements. Existing exact and heuristic methods scale poorly or cannot accommodate dynamic preferences, while learning-based approaches typically require retraining for new constraints. We present DiffusionPack, a planning framework that formulates 3D-BPP as a conditional generation problem and learns the joint distribution of complete packing layouts using a diffusion model. To ensure physical feasibility, diffusion outputs are refined through a projection mechanism guided by point-based heuristics. The method incorporates user guidance at inference: hard constraints are enforced through inpainting, and soft preferences are integrated via guidance functions. Natural language instructions are supported through an LLM that translates user input into constraint specifications. Real-world validation on a Franka robot demonstrate the applicability of our approach to practical robotic packing tasks.

Overview

Key Contributions

Three core technical advances enabling preference-conditioned 3D bin packing

01
Hybrid Diffusion–Projection Planner
A diffusion model jointly predicts complete 3D packing configurations, refined via a keypoint-based projection operator that guarantees physical feasibility without gradient-based projections.
02
Inference-Time Preference Integration
Hard constraints are enforced via inpainting; soft preferences via differentiable guidance functions. No retraining required — preferences are specified at test time over any new instance.
03
Natural Language Conditioning via LLM
A pretrained GPT-4o model translates natural language instructions into executable constraint code, enabling intuitive human–robot interaction without manual engineering of cost functions.

Method

DiffusionPack pipeline: from noisy centroids to feasible packing configurations

PHASE 01
Training
DDPM trains the DiT denoiser with MSE loss on noisy centroid configurations
PHASE 02
Sampling
500 training-step schedule compressed to 250 sampling steps; 512 candidates run in parallel
PHASE 03
Guidance
Differentiable cost functions steer sampling toward soft user preferences
PHASE 04
Selection
512 candidates evaluated; best by Utility Rate or Packing Density returned
Denoising Objective
The model predicts the injected Gaussian noise \(\epsilon_\theta(x_t, c, t)\) from noisy centroid configurations conditioned on cuboid dimensions \(c\). Clean centroids are recovered iteratively from pure noise.
$$\mathcal{L}(\theta) = \mathbb{E}\left[\left\lVert \epsilon - \epsilon_\theta(x_t, c, t) \right\rVert^2\right]$$
A DiT-style transformer with 6 layers, hidden dim 256, and 8 attention heads enables global reasoning across all items simultaneously. No positional encoding ensures permutation invariance.
Keypoint-Based Feasibility
Diffusion outputs are projected onto valid placements using Empty Maximal Spaces (EMS) keypoints — the strongest strategy, directing placements into large unoccupied regions.
$$P_C(x) = \operatorname*{arg\,min}_{y \in C} \left\lVert y - x \right\rVert^2$$
Projection is applied only at the final denoising step, preserving global spatial structure formed during denoising while correcting minor boundary violations.
Hard Constraint Enforcement
Items subject to hard preferences (e.g. "always on top") have their positions overwritten after each denoising step, guaranteeing constraint satisfaction in the final layout.
$$x_{t-1} = (1 - M) \odot \tilde{x}_{t-1} + M \odot y_0$$
\(M\) is a binary mask over constrained items; \(y_0\) provides the reference position from the LLM-generated inpainting rule.
Soft Preference Steering
Soft preferences are encoded as differentiable cost functions. Their gradients bias the denoising trajectory without hard-fixing positions, allowing simultaneous balancing of multiple soft constraints.
$$g = -\sum_i \lambda_i \, \nabla_{x_{t-1}} c_i(x_{t-1})$$
Guidance weights \(\lambda_i \in [1, 25]\) are selected via GPU-parallelised grid search across the 512 candidate batch.

Real Denoising Trajectories

Real DiT model outputs — centroids recorded at 30 DDPM keyframes across 250 denoising steps, with EMS projection at t=0

Speed
Show unplaced
Dataset—
Items—
ProjectionEMS
Candidates512
DDPM steps250
3D Bin — Real DiT Output
Drag to orbit · scroll to zoom
Select an example
Select an example and press Play
Denoising step: — 0%
—
Utility Rate
—
Pack. Density
—
Items Placed
—
Seed
Real model output. Trajectories captured from the trained DiT denoiser running 250 DDPM steps with 512 candidates per instance; the best candidate by Utility Rate is shown. EMS projection is applied only at t=0. CSD examples tile the container perfectly; RSD examples reflect true out-of-distribution performance (~75–85% items placed). Unplaced items shown as ghosts when toggled.

Experimental Results

Evaluated on Cutting Stock Dataset (CSD) and Randomly Sampled Dataset (RSD), 16 and 32 items

Utility Rate — CSD-32
Higher is better · mean ± std over 5 seeds
Utility rates: DiffusionPack-EMS 99.4, GUROBI* 77.6, DBLF+GA 70.8, RCQL 62.6
Utility Rate — RSD-32
Out-of-distribution generalization · 32 items
Utility rates: DiffusionPack-EMS 85.7, GUROBI* 73.6, DBLF+GA 67.5, RCQL 69.6
Preference Satisfaction Rate
vs. DiffusionCCSP · % of instances satisfying all constraints
SR: DiffusionPack 71/66/62, CCSP 52/5/0, DiffusionPack-LLM 66/59/53
Full Comparison Table — Utility Rate (%) and Packing Density (%)
Method Time (s) CSD-16 UR CSD-16 PD CSD-32 UR CSD-32 PD RSD-16 UR RSD-16 PD RSD-32 UR RSD-32 PD
First Fit (EP)0.0156.744.853.243.757.454.467.567.1
Key Point0.0461.353.560.153.563.066.469.769.9
BRKGA1.2058.945.458.145.364.757.671.168.3
DBLF + GA1.4494.582.070.860.371.458.167.565.3
RCQL1.2587.171.862.659.369.157.869.661.3
Ranked-Reward36049.353.850.957.661.964.371.872.0
GUROBI63.2297.181.877.669.374.867.973.668.3
Diffusion-Only8.0548.933.143.434.747.234.249.535.1
Diffusion-CP9.9599.290.193.589.168.364.079.670.7
Diffusion-EP8.5299.190.193.589.568.159.080.371.8
Diffusion-EMS (Ours)6.2299.890.199.490.175.867.385.776.3

Ablation Studies

Effect of projection timing and keypoint strategy on packing quality

Projection Timing — Utility Rate (%)
CSD-16 and CSD-32 · final-step projection is best
Utility rates: No proj 48.9/43.4, Each step 63.3/58.8, Last-10 93.6/91.1, Last-5 98.4/97.7, Last-2 99.3/98.2, Final 99.8/99.4
Why Final-Step Only Works Best
Applying projection at every step overconstrains the sampling process, reducing diversity and preventing the diffusion model from forming coherent global layouts. Early-step projection is ineffective due to high positional variance at large t.

Projection at t=0 allows the diffusion model to fully form a global spatial structure before geometric corrections are applied, preserving the quality of the learned layout prior.
Keypoint Strategy Comparison
Empty Maximal Spaces (EMS) 99.8%
Extreme Points (EP) 99.1%
Corner Points (CP) 99.2%

EMS yields the strongest performance because it directs projections into large unoccupied spaces with high structural freedom.

Human Preference Integration

Hard and soft constraints expressed in natural language, translated by GPT-4o at inference time

Hard Constraint · Inpainting
"Place the red box at the bottom of the bin"
Positions are overwritten after each denoising step. Satisfaction is guaranteed in the final layout. LLM generates a Python inpainting function.
Soft Constraint · Guidance
"Heavy boxes should be near the bottom"
A differentiable cost function biases the denoising trajectory. Allows balancing of multiple soft preferences simultaneously via gradient-based steering.
Spatial Relation
"Keep pink behind green & red above blue"
Relative spatial constraints between named items, encoded as inpainting rules with offsets derived from centroid and dimension tensors.
Grouping
"Group all black items together"
Differentiable proximity cost using cosine similarity on dimension vectors. Note: color-based grouping can fail due to non-differentiable color lookups.

Real-World Validation

Franka FR3 with suction gripper · ten physical packing trials

80%
Task success rate · 8 of 10 trials
Execution Protocol
Objects are localised at trial start using AprilTag fiducial markers. DiffusionPack generates a complete plan offline before execution begins. Items are placed in depth order along the y-axis to prevent gripper collisions with already-placed items.

All cuboid dimensions are inflated by 1 cm during planning to absorb perception and actuation uncertainties. A guarded motion lowers each item until contact is detected.
Robot armFranka FR3 (7-DoF)
End effectorSuction-cup gripper
PerceptionIntel RealSense D435
LocalisationAprilTag fiducials

Citation

If you find DiffusionPack useful, please consider citing our work

@article{diffusionpack2026,
  title   = {DiffusionPack: Offline Bin Packing with Custom Human Preferences},
  author  = {Anonymous Author(s)},
  journal = {Under Review},
  year    = {2026},
  volume  = {},
  pages   = {},
  doi     = {},
  note    = {Under review}
}