LLM Workflow Optimization: A Gemini-Style Partner and an Astra-Style Engineer Working Together

    This article explores a practical approach to speeding up an end-to-end floor plan generation workflow in a mobile spatial measurement tool, using two complementary LLM assistant profiles: a product-oriented partner and an empirical engineer. It explains why the bottleneck shifts from recognition accuracy to workflow smoothness in larger homes, how to measure the process before changing it, and which parallelization and interaction changes can hide waiting time. It also covers a dual-model review loop, prompt structure, acceptance metrics, and common pitfalls, so readers can apply the same division of labor to their own engineering projects.

    1. Background: A Request to Cut Floor Plan Generation to Two or Three Minutes

    In mobile spatial measurement tools, a common approach is to walk through a space with a depth sensor, reconstruct 2D and 3D floor plans, and then let users tap walls to annotate measured dimensions, attach on-site photos, and export reports. When the scenario expands from small or medium homes to large homes over 100 square meters, the capture path becomes longer and the number of walls and rooms increases, which significantly amplifies end-to-end latency. The user experience bottleneck shifts from “how accurate is recognition” to “how smooth is the flow.”

    The goal of this practice was clear: compress whole-home floor plan generation to two or three minutes without changing the underlying recognition capability. The requirements document and local project code were handed to three types of AI coding assistant configurations (a general assistant at high and very high reasoning settings, and an empirical assistant at the maximum reasoning setting), with a request for optimization entry points.

    2. A Counterintuitive Observation: Being Articulate Is Not the Same as Being Effective

    The first round of interaction showed a clear split. The product-oriented assistant was verbose and jargon-heavy in the tool optimization discussion, and two follow-up questions still failed to produce an actionable conclusion. In contrast, in a mini-game numerical and rendering performance test, the empirical assistant quietly ran more than 800 head-to-head simulations in a real game engine in the background and left the other two behind with data.

    This suggests two working styles:

    • Product partner style: good at turning vague requests into requirement boundaries, interaction trade-offs, and risk warnings, with low communication cost and a strong sense of direction.
    • Lab engineer style: no small talk, extremely rigorous, inclined to speak with reproducible experiments and log evidence, and good at catching hidden defects.

    The conclusion is not to rank them, but to divide the work: the former leads requirement gathering and engineering implementation, while the latter challenges proposals and uncovers hidden defects.

    3. The Right Optimization Path: Measure First, Then Change the Flow

    Instead of acting on surface-level guesses such as “swap the underlying model,” the product-oriented assistant first went through on-device diagnostic logs and pointed out that post-processing and modeling took only one or two seconds, while the real room for speedup lay in the overall workflow rhythm. This judgment pulled optimization back from the algorithm layer to the workflow layer and avoided high-risk changes.

    A reusable measurement framework:

    1. Add per-stage instrumentation: capture, point cloud preprocessing, plane segmentation, wall fitting, room closure, texture mapping, and report export, each timed independently.
    2. Separate cold start from the hot path: track first-frame loading, model initialization, and steady-state frame time separately.
    3. Record interaction wait time: manual decision time such as user taps, confirmations, and undo actions must be counted in the end-to-end experience.
    4. Build a baseline dataset: keep samples for small, medium, and large home types so before-and-after results are comparable.

    Illustrative pseudocode:

    1. trace = Profiler.start()
    2. frames = capture(room_path) # Capture
    3. cloud = preprocess(frames) # Preprocessing
    4. walls = fit_walls(segment(cloud)) # Segmentation and fitting
    5. plan = close_rooms(walls) # Room closure
    6. report = export(plan, photos) # Export
    7. Profiler.stop(trace) # Output per-stage timing

    4. Workflow Rhythm Trade-offs: Hide the Waiting

    With recognition capability unchanged, most of the speedup comes from parallelization and interaction reordering:

    • Compute while capturing: start incremental reconstruction once a certain number of frames are captured, instead of waiting until the whole home is captured.
    • Show results early: present a low-precision draft floor plan for user confirmation first, then refine it in the background.
    • Batch confirmation: replace per-wall tapping with per-room batch confirmation to reduce manual back-and-forth.
    • Asynchronous export: move report and photo packaging to a background queue and return a previewable result first.

    At the same time, boundaries must be evaluated: if a change shortens the number of uses or the duration available under a trial entitlement, it touches the entitlement boundary; different site conditions (occlusion, mirrors, narrow hallways) and drawing export expectations (2D annotation, 3D walkthrough, paper printing) also affect trade-offs. Writing these constraints explicitly into the proposal is what makes a final decision possible.

    5. Dual-Model Mutual Review: An Engineering Flow That Maximizes Efficiency

    It is recommended to put the two types of assistants in the same project to review each other’s work and form a closed loop:

    1. Requirements stage: the product partner style outputs the requirements document, interaction trade-offs, and risk list.
    2. Proposal stage: the engineer style challenges the proposal empirically and requires a reproducible experiment design.
    3. Implementation stage: the product partner style generates the code skeleton and instrumentation, while the engineer style adds tests and performance benchmarks.
    4. Acceptance stage: use per-stage timing, number of manual confirmations, and export success rate as hard metrics.

    A four-part prompt structure is recommended:

    1. [Goal] Compress large-home end-to-end latency to under 120 seconds, with the underlying recognition unchanged
    2. [Constraints] Do not break the trial entitlement boundary; support three site conditions and three export expectations
    3. [Evidence] Must cite per-stage timing from on-device logs; no evidence-free guesses
    4. [Output] Optimization list (ranked by benefit/risk) + validation plan + rollback strategy

    6. Acceptance Metrics and Common Pitfalls

    • Metrics: end-to-end P50/P95 latency, number of manual confirmations, export success rate, crash rate.
    • Pitfall 1: optimizing only the algorithm while ignoring interaction wait time, leaving end-to-end time almost unchanged.
    • Pitfall 2: draft precision that is too low and causes rework, which slows down the whole process instead.
    • Pitfall 3: asynchronous export without progress or retry on failure, causing users to click repeatedly.
    • Pitfall 4: no baseline dataset, making optimization impossible to falsify.

    7. Conclusion

    This generation of top-tier models has long split into two working styles. Relying on either one alone leaves blind spots: the communication-oriented one may lack empirical evidence, while the empirical one may not explain things clearly. The truly efficient approach is to let them review each other within the same project—one guarding the direction, the other catching hidden defects, with logs and metrics as the shared judge. For enterprise-grade deployment, the flow can be solidified with general-purpose capabilities (such as object storage for sample data, a message queue for asynchronous export, and a logging service with monitoring and alerting for a per-stage timing dashboard).