deeppavlov / deeppavlov/AutoIntent

`LLMDescriptionScorer` runs cache hits through the `max_per_second` limiter — 10 s per 100 cached utterances

Open
#354 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
54
Forks
16
PR merge metrics
No merged PRs in 30d

Description

What happens

LLMDescriptionScorer._compute_similarities hands every utterance to aiometer.run_all(..., max_at_once=max_concurrent, max_per_second=max_per_second) (llm_encoder.py:247-252); the cache lookup happens inside Generator.get_structured_output_async (_generator.py:266-270), i.e. after the limiter. A fully cached predict on N utterances therefore takes ≥ N / max_per_second seconds — 10 s per 100 utterances at the default max_per_second=10 — doing nothing but dictionary/disk lookups.

Measured (Darinochka/AutoIntent-experiments#43, gpt-6 via OpenRouter)

  • warm pipeline.predict on 100 test utterances: 10.07 s (banking77), 10.12 s (hwu64) — vs 0.002 s for description_typesafe, which looks the cache up first and only sends misses through aiometer (typesafe.py:290-300);
  • HPO: each of the 30 scoring trials re-scores train_1 + validation (all cache hits after trial 1), so the pipeline fit is limiter-bound whether cold or warm — 758 s cold vs 729 s warm on banking77, 649 s vs 618 s on hwu64.

Proposed

Check the cache for all utterances up front and submit only the misses to aiometer.run_all. Needs a cache-only lookup on Generator (e.g. get_cached(messages, output_model) / aget_cached) or access to self.cache; max_per_second then gates real API calls only. Cuts the API arm's HPO wall-clock by roughly an order of magnitude.

Follow-up from #350.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with _description/llm_encoder.py:247-252 and compare the cache-first flow in _description/typesafe.py:290-300. Then inspect Generator.get_structured_output_async in _generator.py:266-270 and determine how cached results can be separated before aiometer.run_all. Done means cache hits bypass max_per_second while misses remain rate-limited.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.