Using Evaluation Systems and Inference-Time Scaling for Beautiful, Scannable QR Code Generation

modal · Tech · 2025 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Generative image quality and QR-code reliability

Modal needed to turn visually impressive QArt-code generation into a production system that reliably produced QR codes that both looked good and scanned.

Constraints:

Architecture

Modal engineered QArt generation around evaluation and selection. Human scanning of thousands of images seeded ground truth, automated QReader and aesthetic predictors were validated against human judgment, Weave logged experiments, parameter sweeps explored generation settings, and production inference generates eight candidates in parallel. Lightweight online evaluators score scan probability and aesthetic quality, then select the best QR code before returning it under the latency budget.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  prompt-and-url-input["Prompt and URL input"] --> qart-generator["QArt generator"]
  qart-generator --> parallel-candidate-generator["Parallel candidate generator"]
  parallel-candidate-generator --> scan-evaluator["Scan evaluator"]
  parallel-candidate-generator --> aesthetic-evaluator["Aesthetic evaluator"]
  scan-evaluator --> candidate-ranker["Candidate ranker"]
  aesthetic-evaluator --> candidate-ranker
  candidate-ranker --> production-response["Production response"]
  qart-generator --> experiment-logging["Experiment logging"]
  scan-evaluator --> experiment-logging
  aesthetic-evaluator --> experiment-logging
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Prompt and URL input Defines the desired visual style and QR destination. QArt generator
QArt generator Uses ControlNet and Stable Diffusion to generate stylized QR-code candidates. Prompt and URL input, Parallel candidate generator
Parallel candidate generator Generates multiple QR candidates per request for inference-time scaling. QArt generator, Scan evaluator, Aesthetic evaluator
Scan evaluator Uses QReader to detect whether candidates scan successfully. Parallel candidate generator, Candidate ranker
Aesthetic evaluator Scores visual quality using an aesthetic rating predictor. Parallel candidate generator, Candidate ranker
Candidate ranker Selects the best generated QR candidate under scan and aesthetic objectives. Scan evaluator, Aesthetic evaluator, Production response
Experiment logging Tracks raw outputs, metrics, sweeps, and visualization for optimization. QArt generator, Scan evaluator, Aesthetic evaluator
Production response Returns the selected scannable visual QR code to users. Candidate ranker

Data flow

A prompt and URL enter the generator, which produces multiple QR-code candidates in parallel. Each candidate is evaluated by scan-detection and aesthetic-scoring models. The service ranks candidates by the validated eval criteria, selects the best scannable/aesthetic result, and returns it to the user, while experiment logs support offline parameter sweeps and metric analysis.

3 supporting quotes
“By generating eight QR codes in parallel for each request and using their evaluation system to rank and select the best candidates”summary, stated
“Modal moved their evaluation pipeline into production, allowing them to rank generated QR codes in real-time based on scan probability and aesthetic scores.”summary, stated
“By logging raw experimental data and creating structured charts and analyses, they could track system performance across different configurations”summary, stated

Why this architecture

Modal treated scan rate as the production KPI and used evaluation-driven selection to manage the probabilistic generator. Because evaluation networks were cheaper than generation, running multiple candidates and selecting the best improved reliability without blowing the latency budget.

“they made a strategic decision to focus primarily on scan rate as their key performance indicator, treating aesthetic quality as a secondary constraint that should not regress.”summary, stated
“their evaluation neural networks were much lighter weight than the generator itself allowed them to run evaluations in production without significantly impacting latency.”summary, stated

Models used: ControlNet · Stable Diffusion · QReader · Aesthetic rating predictor

Scale

Alternatives considered (roads not taken)

Optimize aesthetics and scanability without a clear priority

Rejected because: Modal prioritized scan rate as the KPI and treated aesthetics as a constraint.

“Rather than trying to optimize both simultaneously without clear priorities, they made a strategic decision to focus primarily on scan rate as their key performance indicator”summary, stated

Use manual evaluation for every iteration

Rejected because: Manual scanning created ground truth, but automated evals were needed for scalable parameter sweeps.

“This labor-intensive approach provided ground truth data that could be used to validate automated evaluation systems.”summary, stated
“manual evaluation becomes a bottleneck.”summary, stated

Generate one QR code per request

Rejected because: Parallel generation plus evaluation selection improved scan probability with acceptable latency cost.

“they achieved exponential improvement in scan probability with only sublinear latency cost.”summary, stated

Patterns

eval-driven-development (evaluation)

Modal used human-aligned automated scan and aesthetic evaluations to drive parameter sweeps and production candidate selection.

“The evaluation system development process illustrates best practices for LLMOps evaluation engineering. Modal started with manual human evaluation processes, having team members physically scan thousands of QR codes with iPhones while recording results and aesthetic judgments.”summary, stated
“The team ran alignment experiments on approximately 2,000 prompt-URL pairs to ensure their automated metrics correlated with human assessments.”summary, stated

llm-as-judge (evaluation)

Although the evaluator was not a general LLM, Modal used learned evaluators as production judges to score generated QR outputs before serving.

“using the QReader library for scan detection and an aesthetic rating predictor from the Stable Diffusion community.”summary, stated
“Modal moved their evaluation pipeline into production, allowing them to rank generated QR codes in real-time based on scan probability and aesthetic scores.”summary, stated

batch-offline-processing (optimization)

Modal ran large parameter sweeps over generated images once automated evaluations were trusted.

“Once they had established trusted automated evaluations, they could sweep over configuration parameters by generating tens of thousands of images”summary, stated

latency-optimization (serving)

The service used parallel candidate generation and lightweight evaluators to improve reliability while staying under the response-time target.

“leverages the parallel processing capabilities of GPUs effectively while maintaining acceptable response times.”summary, stated

Tradeoffs

Primary scan-rate objective

Chose Optimize scan rate first while preventing aesthetic regression over Treat scanability and aesthetics as equal objectives.

Rationale: A beautiful QR code that does not scan fails the product's core function.

“they made a strategic decision to focus primarily on scan rate as their key performance indicator, treating aesthetic quality as a secondary constraint”summary, stated

Inference-time compute scaling

Chose Generate eight candidates and select the best over Return the first generated QR code.

Rationale: Parallel sampling improved scan probability substantially while adding only sublinear latency.

“By generating eight QR codes in parallel for each request and using their evaluation system to rank and select the best candidates”summary, stated
“achieved exponential improvement in scan probability with only sublinear latency cost.”summary, stated

Online evaluation in production

Chose Score generated candidates at request time over Use offline evaluations only for development.

Rationale: Real-time ranking let the production service consistently choose higher-quality outputs.

“Rather than running evaluations only offline, Modal moved their evaluation pipeline into production, allowing them to rank generated QR codes in real-time based on scan probability and aesthetic scores.”summary, stated

Gotchas (what bit them)

Viral AI demos did not translate into reliable production behavior.

Root cause: Stylized QR generation was probabilistic and failed across diverse prompts and scenes.

Resolution: Modal built validated automated evaluations and production candidate selection.

“the gap between impressive demos and consistent production performance.”summary, stated
“While the original QArt codes concept worked well for certain prompts and styles, it failed to reliably produce scannable codes across diverse prompts and complex scenes. This inconsistency represents a fundamental barrier to production deployment that many AI applications encounter.”summary, stated

Automated evaluators themselves needed evaluation.

Root cause: Scan and aesthetic metrics only help if they correlate with human judgment.

Resolution: Modal ran alignment experiments against human scanning and aesthetic judgments.

“the concept of "evals for evals" - the recognition that automated evaluation systems themselves need to be validated against human judgment.”summary, stated

Optimizing two objectives without hierarchy can stall production decisions.

Root cause: Aesthetic appeal and scanability can conflict.

Resolution: Modal made scan rate the primary KPI and kept aesthetics as a non-regression constraint.

“The team recognized that their system had two competing objectives: producing scannable QR codes and maintaining aesthetic quality.”summary, stated
“Rather than trying to optimize both simultaneously without clear priorities, they made a strategic decision to focus primarily on scan rate as their key performance indicator, treating aesthetic quality as a secondary constraint that should not regress.”summary, stated

Evaluation

Modal combined human scanning and aesthetic judgments, QReader scan detection, an aesthetic predictor, alignment experiments, parameter sweeps, Weave experiment tracking, online ranking, and service-level scan-rate/latency metrics.

Metrics: 95% scan-rate SLO · Sub-20-second response time · Approximately 2,000 prompt-URL alignment pairs · Eight generated candidates per request · Scan probability and aesthetic score

3 supporting quotes
“The team developed automated evaluation pipelines that measured both scan rate and aesthetic quality, using human judgment alignment to validate their metrics.”summary, stated
“Modal's achievement of a 95% scan rate service-level objective while maintaining sub-20-second response times demonstrates that rigorous LLMOps engineering can bridge the gap between research demos and production systems.”summary, stated
“The team's use of Weights & Biases' Weave for experiment management and data visualization demonstrates the importance of proper tooling in LLMOps workflows.”summary, stated

Outcomes

The system moved from thousands of manually scanned QR codes and 2,000-pair eval alignment to production inference with eight candidates per request and online scoring.

“Modal's achievement of a 95% scan rate service-level objective while maintaining sub-20-second response times demonstrates that rigorous LLMOps engineering can bridge the gap”summary, stated
“This scalability is crucial for production AI systems where manual evaluation becomes a bottleneck.”summary, stated