Skip to content

Evaluation: Optional duplication factor #1105

Closed

Description

@AkhileshNegi

Is your feature request related to a problem?
The duplication_factor is set at the time of dataset upload and cannot be changed at runtime. This requires re-uploading the dataset to evaluate it with a different duplication factor, which is inefficient.

Describe the solution you'd like
Add an optional duplication_factor parameter to the v2 evals run endpoint:

  • In evaluate_v2: add duplication_factor: int | None = Body(None, ...) and pass it to validate_and_start_fast_evaluation.
  • In _load_items_from_object_store: accept an optional override for the duplication factor; if provided, use it instead of the stored value.
  • In the summary path: read the duplication_factor from the dataset metadata for accurate calculations, using the override when available.
  • Ensure this feature only applies to v2 datasets, with v1 datasets rejecting the override.
Original issue

Problem

duplication_factor is fixed at dataset upload time — stored in dataset_metadata (DATASET_META_DUPLICATION_FACTOR) and baked in when the dataset is created (backend/app/api/routes/evaluations/dataset_v2.py:41, backend/app/services/evaluations/dataset.py:35).

At run time, POST /evaluations (v2 trigger, backend/app/api/routes/evaluations/evaluation_v2.py:32) has no way to change it — _load_items_from_object_store in backend/app/services/evaluations/fast.py:91 always falls back to the dataset's stored factor:

metadata = dataset.dataset_metadata or {}
duplicate_at_runtime = bool(metadata.get(DATASET_META_DUPLICATE_AT_RUNTIME, False))
duplication_factor = (
    max(1, int(metadata.get(DATASET_META_DUPLICATION_FACTOR, 1)))
    if duplicate_at_runtime
    else 1
)

To re-run the same uploaded dataset at a different duplication factor, you currently have to re-upload it. Datasets are otherwise reusable across runs (different configs, models) — duplication factor shouldn't force a re-upload.

Proposal

Add an optional duplication_factor param to the v2 evals run endpoint:

  • evaluate_v2 (backend/app/api/routes/evaluations/evaluation_v2.py): optional duplication_factor: int | None = Body(None, ...), threaded through validate_and_start_fast_evaluation.
  • _load_items_from_object_store (backend/app/services/evaluations/fast.py:91): accept an optional override param; when passed, use it instead of metadata.get(DATASET_META_DUPLICATION_FACTOR, 1). When absent, fall back to current behavior (dataset's stored factor, or 1 if not runtime-duplicated).
  • attach_cost/summary path (backend/app/crud/evaluations/fast.py:1141) reads duplication_factor from dataset metadata for the ai_summary math (repetition-aware averaging) — needs the same override threaded through so the summary reflects the factor actually used for that run, not the dataset's stored default.

Only applies to v2 (runtime-duplicated) datasets — v1 datasets are physically duplicated in the CSV already, factor forced to 1, override should be a no-op or rejected for those.

Why

Makes an uploaded v2 dataset reusable at different duplication factors without re-uploading — e.g. quick sanity check at 1x, full eval at 5x, same dataset either way.

Activity

  1. changed the title [-]Allow overriding dataset duplication_factor at evals v2 run time[/-] [+]Evaluation: Optional duplication factor[/+] on Aug 3, 2026
  2. self-assigned this
    on Aug 7, 2026
  3. moved this from To Do to In Progress in Kaapi-devon Aug 17, 2026
  4. moved this from In Progress to Closed in Kaapi-devon Aug 18, 2026
  5. github-actions commented on Aug 18, 2026

    @github-actions

    🎉 This issue has been resolved in version 1.5.0-main.4 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions