Testing Multimodal Agents: How to Reproduce Counting and Spatial Tasks

    This article explores how to reliably reproduce counting and spatial reasoning results from multimodal AI research papers using public entry points like web interfaces or CLIs. It provides a practical guide for developers on setting up a reproducible CLI environment, designing comprehensive test sets for counting and maze tasks, and conducting control experiments to identify whether performance gaps stem from the entry point, parameters, or prompt engineering.

    1. Defining Problems and Boundaries Before Testing

    Multimodal model demonstrations often originate from research papers or official demos. However, developers typically interact with a specific public entry point, such as a web-based image recognition mode, an Agent integration environment, or a command-line interface (CLI) tool. Different entry points may use varying model versions, system prompts, maximum output length limits, and image preprocessing techniques. Therefore, a model’s performance on one entry point cannot be directly equated to another.

    This article focuses on three core questions:

    1. Can the counting and spatial planning examples from research papers be reproduced using public entry points?
    2. If they cannot be reproduced, do the discrepancies stem from the entry point, parameters, or the prompt?
    3. How should developers set up a reproducible testing environment?

    This article only describes testing methodologies and does not draw conclusions about the internal mechanisms of the models. The figures cited are based on public feedback and have not been independently verified by the author. Readers should rely on their own test results.

    2. Installing and Configuring a Reproducible CLI Environment

    2.1 Recording the Baseline Environment

    Before starting, write the following information into your test report. Without this information, others will be unable to reproduce your results.

    • Operating system and version
    • Node.js and npm versions
    • CLI package name and specific version number
    • Access entry point (Web, Agent, or CLI)
    • Test date and model identifier
    1. node -v
    2. npm -v
    3. npm ls -g --depth=0

    2.2 Installing Specific Versions in an Isolated Prefix

    Executing a global update directly might overwrite existing versions or fail due to insufficient permissions. It is recommended to verify the global installation directory first, then install a specific fixed version.

    1. # View available versions; replace <cli-package> with the package name from the official documentation
    2. npm view <cli-package> versions --json
    3. # View the global installation directory; if it requires root permissions, switch to user-level Node managers like nvm
    4. npm config get prefix
    5. # Install a fixed version; replace <version> with the version number selected in the previous step
    6. npm install -g <cli-package>@<version>

    Avoid using sudo for installation directly on production machines. When permissions are insufficient, prioritize using a user-level Node version manager.

    2.3 Verifying Parameters Before Launch

    The startup parameters in articles or documentation might not align with the current version. Before launching, review the help information to confirm parameter names and configuration file formats.

    1. <cli-package-bin> --help
    2. <cli-package-bin> --version

    If the CLI supports configuration file parameters, rely on the actual names shown in the help information rather than copying syntax from older articles.

    2.4 Rollback Strategy

    If behavioral changes occur after an upgrade, immediately roll back to the recorded version and compare the outputs before and after.

    1. npm install -g <cli-package>@<previous-version>
    2. npm ls -g --depth=0

    3. Designing Tests for Counting and Maze Tasks

    3.1 Constructing the Test Set

    Conclusions drawn from a single image are not representative. It is recommended to construct test sets based on the following dimensions:

    • Counting tasks: Crowds, retail shelves, component defects, etc. Use at least 20 images per category. Ground truth should be independently annotated by two individuals and cross-checked.
    • Spatial tasks: Mazes, route maps, multi-tier shelf paths. Use at least 10 images per category. Use target reachability as the pass criterion.
    • Image resolution: Keep both the original and a downscaled version for each image.
    • Interference conditions: Include a certain proportion of occlusions, overlapping targets, and low-contrast scenarios.

    3.2 Fixing Variables and Logging

    Fix the following parameters for each test and write them to the log:

    Parameter Requirement
    Model identifier Must match the report; record the complete string
    Temperature Set to 0 or the minimum value allowed by the entry point; record the default if it cannot be set
    Max output tokens Test different tiers such as 2048, 8192, and 32768
    Timeout Record the set value and the actual number of timeouts
    Repetition count At least 10 runs per task
    Prompt Save the full text, including prefix instructions

    3.3 Result Recording Table

    The table below lists the recommended fields for logging. The data in the first row is from public feedback where the original testing conditions are unknown, hence marked as pending testing.

    Task Paper Expectation Public Feedback Result Test Conditions Reproduced?
    Dense counting (Team group photo, ground truth: 25) Outputs 25 Web vision mode outputs 27 To be filled (image, prompt, resolution, parameters) To be tested
    Maze route planning Outputs a viable route Web output route is invalid To be filled (maze size, prompt, repetition count) To be tested

    When recording, distinguish between three outcomes: fully reproduced, partially reproduced, and not reproduced. A task can only be marked as “not reproduced” if it fails to meet the paper’s standard after multiple repetitions. A single failure does not prove the model lacks the capability.

    4. Identifying Sources of Discrepancy and Verification Methods

    4.1 Common Hypotheses

    When counting or routing results do not align with the paper, possible reasons include:

    1. Different entry point versions: The web interface and the paper may not use the same model configuration.
    2. Output truncation: The model hits the token limit during long reasoning chains, causing the final answer to be missing or degraded in quality.
    3. Prompt fails to trigger target mode: The prefix instruction format is incorrect, or it is overridden by the system prompt.
    4. Image preprocessing: The entry point might compress or crop the image, leading to the loss of small targets.
    5. Randomness: The result distribution across multiple runs of the same input is too wide.

    These hypotheses need to be verified one by one; you cannot just pick one based on a single result.

    4.2 Control Experiment Steps

    1. Fix the image and prompt, only changing the max output tokens. Repeat 10 times per tier and calculate accuracy and truncation rates.
    2. Fix the parameters, only changing the prompt prefix. For example, test no prefix, [Think with Grounding], and [Think with Pointing] respectively, and compare whether the output format changes.
    3. Fix the prompt and parameters, testing with both the original and compressed images to observe changes in counting errors.
    4. Switch between different entry points to check if the results for the same input are consistent.

    For each experiment group, save the raw output, thought chain length, duration, and whether a timeout occurred.

    4.3 Troubleshooting Table

    Symptom Possible Cause Troubleshooting Action
    Output ends midway Insufficient max output tokens or timeout Increase the limit, check timeout logs
    Prefix instruction has no effect Format error or not supported by entry point Cross-check with documentation, save outputs before/after for comparison
    Counting results vary each run High randomness Lower temperature, increase repetitions, and record distribution
    CLI throws parameter error on startup Version mismatch with documentation Run --help, modify according to the current version
    Behavioral changes after upgrade Version change Roll back to the recorded version, compare outputs

    5. Practical Checklist

    Before deployment, confirm the following:

    • Recorded model identifier, entry point, CLI version, and test date
    • Test set covers counting, spatial, occlusion, and low-resolution dimensions
    • Each task repeated at least 10 times, reporting result distribution instead of single runs
    • Tested at least two tiers of max output tokens and recorded truncation rates
    • Saved complete prompts and raw outputs
    • Prepared rollback version and rollback command

    During operation, it is recommended to continuously monitor the following metrics:

    • Number of thought tokens per call and their percentiles
    • Timeout and truncation rates
    • Reproducibility rate for the same input
    • Mean absolute error for counting tasks
    • Viability rate for route planning

    These metrics help teams determine whether the issue lies with the model, the parameters, or the workflow itself.

    6. Conclusion

    Multimodal visual primitives have clear research value in theory, but their actual performance on public entry points must be verified through a standardized process. Developers should first record their environment, then design a test set, and finally use control experiments to isolate the respective impacts of the entry point, parameters, and prompts. Until sufficient evidence is gathered, do not treat a single test result as a definitive conclusion about the model’s underlying mechanisms.