Research: recall triggers (hooks docs, prior art, retrieval quality)
Eyes facts file serving eureka-substrate:ruling:recall-triggers-rescoped: which Claude Code hook events carry additionalContext and reach subagents, whether PreToolUse updatedInput can rewrite an Agent brief or an MCP call, proactive-recall prior art, and practice for thresholding semantic hits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
614caf8832
commit
f09826cc28
1 changed files with 93 additions and 0 deletions
93
docs/research/recall-triggers-prior-art.md
Normal file
93
docs/research/recall-triggers-prior-art.md
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
# Recall triggers: hooks docs, prior art, retrieval quality (facts only)
|
||||
|
||||
Serves: `eureka-substrate:ruling:recall-triggers-rescoped` (2026-10-22). Context: `eureka-substrate:ruling:recall-pops-into-context`, `eureka-substrate:ruling:admit-near-duplicate-deny-once`, follow-ups `eureka-substrate:follow_up:gap-semantic-page-no-score` and `gap-semantic-one-text-per-query`.
|
||||
Pass: Eyes, session self-2026-10-23-eureka-b, 2026-10-23. Facts and pointers only; no recommendation. "Not verified" marks what the sources did not show.
|
||||
|
||||
Method note: the hooks reference was read through WebFetch (a small-model summariser over the page, 274,119 chars, read in three 100k windows); quoted blocks below are what it returned as verbatim. The changelog was read in its first 200k of 1.1M chars only.
|
||||
|
||||
## A. Claude Code hooks (current docs)
|
||||
|
||||
Primary source: https://code.claude.com/docs/en/hooks (also reachable as docs.anthropic.com/en/docs/claude-code/hooks). Changelog: https://code.claude.com/docs/en/changelog (entries up to 2.1.307 seen; the installed claude probed in the cut_spec was 2.1.268).
|
||||
|
||||
### A1. Can PreToolUse modify tool input?
|
||||
|
||||
- Field and shape (section "PreToolUse decision control"): decision lives inside `hookSpecificOutput` with `hookEventName: "PreToolUse"`, fields `permissionDecision` (`allow|deny|ask|defer`), `permissionDecisionReason`, `updatedInput`, `additionalContext`.
|
||||
- `updatedInput`, verbatim: "Modifies the tool's input parameters before execution. Replaces the entire input object, so include unchanged fields alongside modified ones. Claude Code evaluates permission rules and a Bash command's auto-background eligibility against the input your hook returns, not the input Claude sent. Combine with `"allow"` to auto-approve, or `"ask"` to show the modified input to the user. For `"defer"`, ignored".
|
||||
- Precedence across hooks: "deny > defer > ask > allow". Conflict handling between several hooks' `updatedInput`: not documented in the page text read.
|
||||
- Which tools: the docs describe `updatedInput` generically ("the tool's input parameters"); worked examples are Bash, `AskUserQuestion` and `ExitPlanMode` ("need `updatedInput` paired with "allow""). No sentence in the page text read says it works, or does not, for the Agent tool or for MCP tools.
|
||||
- Agent tool schema in the PreToolUse input section (tool_name `Agent`; `Task` does not appear in the text read; one web source says "wire name Task for backward compatibility", not from the docs): `prompt` (string, "The task for the agent to perform"), `description`, `subagent_type`, `model` (optional alias).
|
||||
- Agent-tool `updatedInput` is reported broken by users, not by the docs:
|
||||
- https://github.com/anthropics/claude-code/issues/39814 "PreToolUse hook `updatedInput` silently ignored for Agent tool": hook fires, `permissionDecision` and `additionalContext` from the same response are honoured, but the subagent receives the original `prompt`. Reported on macOS, Claude Code 2.1.85+, single command hook. Closed "not planned" by the stale bot 2026-05-21, no maintainer reply, no fix version, locked 2026-07-10. A comment states "`updatedInput` isn't supported for all tools" (user comment, not an official statement). The reporter's workaround: inject text through a `SubagentStart` hook; "works only with the `hookSpecificOutput` wrapper", a bare top-level `additionalContext` is silently ignored.
|
||||
- https://github.com/anthropics/claude-code/issues/44412 same symptom with `model` in `updatedInput`; closed as duplicate of 39814 on 2026-04-10; no human replies.
|
||||
- Changelog entries touching the area: 2.1.290 "Fixed some permission rules and safety checks not being applied to a tool call after a PreToolUse hook rewrote its input"; 2.1.300 "`updatedInput` from PreToolUse and PermissionRequest hooks is now validated like Claude's own input: unknown keys are dropped, and input the tool rejects denies the call". Neither names the Agent tool. No changelog entry found (first 200k chars) saying Agent `updatedInput` was fixed. Whether it works on the current release: not verified by any source; nobody ran a probe in this pass.
|
||||
- A separate, non-settings mechanism: 2.1.300 "Added support for rewriting a workflow agent's `prompt` and `model` in the `agent.spawn` mod hook, which could only refuse workflow agents before"; 2.1.289 "Added `agent.spawn` for teammates". These are plugin "mod" hooks (see the `plugin-authoring` skill in this install), scoped in the entry to workflow agents. Not found in the hooks reference text read. Web search found no third-party description of `agent.spawn`.
|
||||
- MCP tools: `Match MCP tools` section: MCP tools "appear as regular tools in tool events (`PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied`)". Name pattern `mcp__<server>__<tool>`. PreToolUse input for an MCP tool also carries `mcp_server` {`name`, `source`} ("requires Claude Code v2.1.274 or later"). Whether `updatedInput` rewrites MCP arguments: not stated; the 2.1.299 changelog line "Fixed plan mode running a write (an MCP tool's, ...) that a `PreToolUse` hook ... allowed" shows PreToolUse allow/deny applies to MCP tools. Web search: no source confirms MCP `updatedInput`.
|
||||
- For `mcp__eureka-state__admit`: deny with `permissionDecisionReason` is documented behaviour ("For `"deny"`, shown to Claude"); exit 2 routes the same way: "Claude sees the stderr message as the denial reason". This is the mechanism ruling admit-near-duplicate-deny-once names.
|
||||
- Hook handler types that exist: `command`, `http`, `prompt`, `agent`, `mcp_tool` (an `mcp_tool` handler has fields `server`, `tool`, `input` with `${tool_input.x}` substitution).
|
||||
|
||||
### A2. Which events inject `additionalContext`, and subagents
|
||||
|
||||
Section "Add context for Claude" (verbatim list of where the reminder appears):
|
||||
- SessionStart and SubagentStart: "at the start of the conversation, before the first prompt"
|
||||
- UserPromptSubmit and UserPromptExpansion: "alongside the submitted prompt"
|
||||
- PreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch: "next to the tool result"
|
||||
- Stop and SubagentStop: "at the end of the turn. The conversation continues so Claude can act on the feedback"
|
||||
- PostModelSwitch: "with the next request after the switch"
|
||||
- "Claude Code wraps the string in a system reminder and inserts it into the conversation at the point where the hook fired." "When several hooks return `additionalContext` for the same event, Claude receives all of the values." `<system-reminder>` tags inside the string are escaped (`<`). PreToolUse `additionalContext` is "Ignored when `permissionDecision` is `"defer"`".
|
||||
- Docs advice: "Write the text as factual statements rather than imperative system instructions ... Text framed as out-of-band system commands can trigger Claude's prompt-injection defenses, which causes Claude to surface the text to you".
|
||||
- Persistence: injected text is saved in the transcript; on `--continue`/`--resume` it is replayed, not re-run, except `SessionStart`, which re-runs with `source` `"resume"` or `"fork"`.
|
||||
- SessionStart output fields: `additionalContext`, `initialUserMessage` (non-interactive `-p` only), `sessionTitle`, `watchPaths`, `reloadSkills`; plain-text stdout also added to context. 2.1.290: "Fixed an async SessionStart hook's unchanged context being added to the conversation again on every resume".
|
||||
- UserPromptSubmit output fields: `decision` (`"block"`), `reason`, `additionalContext`, `sessionTitle`, `suppressOriginalPrompt`.
|
||||
- PostToolUse output fields: `decision`, `reason`, `additionalContext`, `classifierContext`, `updatedToolOutput`, `updatedMCPToolOutput` ("only changes what Claude sees").
|
||||
- SubagentStart (exists): "Runs when Claude spawns a subagent with the Agent tool, when Claude resumes a subagent, and each time an in-process agent team teammate handles a new message." Matcher is agent type name (`general-purpose`, `Explore`, `Plan`, custom `name` from frontmatter, plugin form `^my-plugin:reviewer$`). Input: common fields plus `agent_id`, `agent_type` only (example JSON has no `prompt`, no task text). Output: "SubagentStart hooks can't block subagent creation, but they can inject context into the subagent": `additionalContext`, "String added to the subagent's context at the start of its conversation, before its first prompt." Re-run for the same subagent: injected "only when the subagent's context doesn't already hold the copy from an earlier run" (prompt cache preserved).
|
||||
- SubagentStop input: common plus `stop_hook_active`, `agent_id`, `agent_type`, `agent_transcript_path`, `last_assistant_message`; `decision: "block"` with `reason` "keeps the subagent running and delivers `reason` to the subagent as its next instruction". Docs: "To inject context into the parent session after a subagent returns, use a PostToolUse hook on the `Agent` tool instead."
|
||||
- Hooks inside subagents, verbatim: "Hooks from settings files, managed policy settings, and plugins also run inside subagents. When a subagent calls a tool, tool events such as `PreToolUse` and `PostToolUse` fire the same configured hooks as in the main conversation, and the input carries the `agent_id` and `agent_type` common input fields". So a settings-file PreToolUse hook on `mcp__eureka-state__admit` fires when a subagent calls it. Subagent-frontmatter hooks run only while that subagent runs ("Claude Code converts a `Stop` hook here to `SubagentStop`"); a user comment in an issue search result says frontmatter hooks were not executing for Task-tool subagents (https://github.com/anthropics/claude-code/issues/18392, snippet only, not read).
|
||||
- UserPromptSubmit fires on user prompts of the root session; docs read give no event for a subagent's own start besides SubagentStart. The docs read name no hook that receives the Agent `prompt` other than PreToolUse (matcher `Agent`) and PostToolUse on `Agent`.
|
||||
- Other events listed (33): SessionStart, Setup, UserPromptSubmit, UserPromptExpansion, PreToolUse, PermissionRequest, PermissionDenied, PostToolUse, PostToolUseFailure, PostToolBatch, Notification, MessageDisplay, SubagentStart, SubagentStop, TaskCreated, TaskCompleted, Stop, StopFailure, TeammateIdle, InstructionsLoaded, ConfigChange, CwdChanged, DirectoryAdded, FileChanged, WorktreeCreate, WorktreeRemove, PreCompact, PostCompact, PreModelSwitch, PostModelSwitch, Elicitation, ElicitationResult, SessionEnd. `InstructionsLoaded` input carries `agent_id`/`agent_type` when a subagent's file access loads a rule or nested CLAUDE.md (changelog 2.1.288). `PostCompact` exists (section not read).
|
||||
|
||||
### A3. Limits
|
||||
|
||||
- Timeouts (common fields table): default 600 s for `command`, `http`, `mcp_tool`; 30 s for `prompt`; 60 s for `agent`; "Lowered to 30 for `command`, `http`, and `mcp_tool` on `UserPromptSubmit`, `PreModelSwitch`, and `PostModelSwitch`, and to 10 on `MessageDisplay`"; SessionEnd shares a 1.5 s budget (raisable to 60 s); no `timeout` enforcement for `async: true` command hooks. Per-hook `timeout` field in seconds (example config uses `"timeout": 5`).
|
||||
- Size: "A hook's `additionalContext`, `systemMessage`, and `initialUserMessage` strings, and its plain stdout, are capped at 10,000 characters", each field measured separately. Over the cap: "Claude Code writes the text to a file in the session directory and passes Claude the file path with a preview of up to the first 2,000 characters instead. Claude can read the file, but Claude Code doesn't ask it to." "this cap has no setting or environment variable to raise it."
|
||||
- Failure: exit 0 success; exit 2 "Blocking error ... On events that can block, Claude Code stops the action"; any other exit code is a non-blocking error and the action goes ahead; "Exit code 1 without valid JSON output is a non-blocking error". For PreToolUse a timed-out command/http/mcp_tool hook "doesn't block the tool call" unless `"onFailure": "block"` (requires v2.1.295+, default `"continue"`). 2.1.288: "Fixed PreToolUse and PermissionRequest hooks being skipped when matching them failed or the tool's input could not be serialized to JSON; the call is now blocked". Whether a timed-out UserPromptSubmit hook's output is discarded: not stated in the text read.
|
||||
- Matcher syntax: a matcher of only "letters, digits, `_`, `-`, spaces, `,`, and `|`" is an exact string or list of exact strings; any other character makes it an unanchored JavaScript regular expression. MCP: `mcp__<server>__<tool>`; whole server needs `.*` ("a matcher like `mcp__memory` ... matches no tool"); `mcp__eureka-state__.*` fits the pattern (hyphen is allowed in the exact-match set; `.*` forces regex). Plugin servers: `mcp__plugin_<plugin>_<server>__<tool>`. Hook entries also take an `if` field (section "common fields", not read in full).
|
||||
- `<system-reminder>` escaping in hook output: changelog 2.1.292.
|
||||
- "async" and `onFailure` fields exist; `agent_id` on PreToolUse input: the PreToolUse input section was past the readable window; the "Hooks in subagents" section says tool-event inputs carry it.
|
||||
|
||||
### Disagreements with the installed probes
|
||||
|
||||
Checked against: `C:\Users\Meta\.claude\skills\eureka\tools\recall.py` docstring and `eureka-substrate:cut_spec:cut-recall-prompt.r1` `first`.
|
||||
- recall.py docstring makes one hooks claim: "Claude Code caps additionalContext at 10,000 characters" (comment on `MAX_BUDGET = 9000`). Docs agree on the number; docs add that over-cap text is written to a file with a 2,000-character preview rather than dropped.
|
||||
- cut_spec `first`: 10,000-char cap (agrees); "cuts UserPromptSubmit command hooks at 30 s by default" (agrees); "honours a per-hook `timeout` in seconds" (agrees); "discards a timed-out hook's output" (not stated in text read); "never blocks the prompt on a hook failure or a non-2 exit" (agrees for non-2 exits; docs add exit 2 does block on blocking events, and `onFailure: "block"` exists from v2.1.295, default continue); input field list `prompt, session_id, cwd, transcript_path, prompt_id, permission_mode, hook_event_name` (docs' common fields also list `scratchpad_dir` (v2.1.257+), `effort`, `agent_id`, `agent_type`; the UserPromptSubmit-specific `prompt` field was not in the windows read). No disagreement found on anything else; the cut_spec makes no claim about PreToolUse, `updatedInput`, SubagentStart or subagents.
|
||||
- The ruling `recall-triggers-rescoped` says the prompt hook "fires only on the operator's own messages, in the root session, and no subagent ever sees it": docs read show UserPromptSubmit placement "alongside the submitted prompt"; they list no UserPromptSubmit firing for subagents; they do say tool hooks and (via SubagentStart) context injection reach subagents.
|
||||
|
||||
## B. Prior art: proactive / just-in-time memory recall
|
||||
|
||||
Each entry: trigger moment; what decides relevance; noise bound; known failures. Sources are primary; "abstract only" marks what could not be read in full.
|
||||
|
||||
1. MemGPT (Packer et al., arXiv 2310.08560, v2 2024-02-12; Letta is its product). Trigger: the LLM itself calls recall/archival search functions; plus system "memory pressure" warning at about 70% of context and eviction at the flush threshold (about 50% evicted, folded into a recursive summary) (read via ar5iv). Relevance: vector search over archival storage; recall storage holds full history. Noise: results paginated "so a single search cannot overflow the context window". Failures stated: model-dependent (GPT-3.5 weak at function calling), "MemGPT sometimes stops paginating before it has searched the whole retriever database", embedding retrieval often ranks the gold document well below top results; small evaluation (50 DocQA questions). Letta docs (https://docs.letta.com/guides/agents/memory): memory blocks "pinned to the system prompt" (always in context); old messages retrievable by "retrieval tools". Letta V1 SDK noted as being deprecated for the Agent SDK.
|
||||
2. Generative Agents (Park et al., arXiv 2304.03442). Trigger: agent retrieval when it plans or reacts (query = a memory/situation). Relevance: weighted sum of recency (exponential decay 0.995 per game hour since last retrieved), importance (LLM-rated integer 1-10 at creation) and relevance (embedding cosine), each min-max scaled to [0,1], all weights 1. Noise: "the top-ranked memories that fit within the language model's context window". Failures stated: most common errors "when the agent failed to retrieve relevant memories" (Sec 6.5.2); retrieval gets harder as memory grows (Sec 7.2); memory-hacking robustness (Sec 8.2).
|
||||
3. Reflexion (Shinn et al., arXiv 2303.11366). Trigger: start of each later trial after a failed one; reflection text stored in an episodic buffer. Relevance: no retrieval scoring; the buffer is kept in the prompt (abstract only; the exact insertion rule and the bounded buffer size were not read). Noise: not covered by the abstract.
|
||||
4. Voyager (Wang et al., arXiv 2305.16291). Trigger: when the agent starts a new task, before code generation. Relevance: embedding (text-embedding-ada-002) of the skill description (GPT-3.5 generated) as key; the query is an embedding of a self-generated task plan plus environment feedback; top 5 skills retrieved (read via ar5iv). Noise: fixed top-5. Failures stated are general (agent stuck, self-verification misses, hallucinated functions, GPT-4 cost); none specific to retrieval.
|
||||
5. FLARE / Active RAG (Jiang et al., arXiv 2305.06983, EMNLP 2023). Trigger: mid-generation, per sentence: draft the next sentence, retrieve only if any token's probability is below θ (0.8 on most tasks, 0.4 on StrategyQA). Relevance: query is the draft sentence with tokens below β=0.4 masked (unmasked, β=0, performed worse), or LLM-generated questions per low-confidence span. Noise: θ gate; retrieval fired for about 30-60% of sentences; only the most recent retrieved documents kept in context. Failures: no significant gain on Wizard of Wikipedia (short output) or ELI5; extra LM calls per retrieval.
|
||||
6. Self-RAG (Asai et al., arXiv 2310.11511). Trigger: a trained model emits a reflection token deciding whether to retrieve ("adaptively retrieves passages on-demand"), instead of "a fixed number of passages". Relevance: reflection tokens critique retrieved passages and the output (detail not read; abstract only). Noise: on-demand gating plus critique. Failures: not in abstract.
|
||||
7. A-MEM (Xu et al., arXiv 2502.12110, NeurIPS 2025). Trigger: on write, a new note is analysed against old memories and linked; on retrieval, agent-driven (abstract only). Relevance: Zettelkasten-style notes with keywords, tags, context, links, with updates to linked memories. Noise and failure: not described in the abstract.
|
||||
8. Mem0 (Chhikara et al., arXiv 2504.19413; docs https://docs.mem0.ai/core-concepts/memory-operations/search). Trigger: application calls `search`; docs do not prescribe per-message ("the docs don't prescribe calling search on every message"; with the Mem0 MCP agents search "proactively when needed"). Relevance: cosine similarity; params `top_k`, `threshold` ("minimum similarity score"), `rerank` (default False; second pass when a reranker is configured), `filters` (always scope by `user_id`); OSS `explain=True` returns `score_details` (semantic score, normalised BM25, entity boost, threshold). Paper claims on LOCOMO: 26% relative LLM-judge gain over OpenAI, 91% lower p95 latency, over 90% fewer tokens than full-context (abstract). Failure modes: not stated in sources read.
|
||||
9. LangGraph long-term memory (https://docs.langchain.com/oss/python/langgraph/memory). Trigger: write either "in the hot path" (agent decides while responding; costs latency and attention) or "in the background" (separate task; "choosing how often to write ... when to trigger, such as after a time delay, on a cron schedule, or manually"). Read: `store.search(namespace, filter=..., query=...)`, semantic via `query` sorted by vector similarity, content `filter`; namespaces as folders. The page "doesn't give a general pattern" for injecting results into prompts; the example reads procedural memory with `store.get` into the prompt template in a model-call node. `limit` not documented on the page.
|
||||
10. Cursor rules (https://cursor.com/docs/context/rules). Four trigger modes, verbatim table: Always Apply ("Every chat session"; nothing decides relevance); Apply Intelligently (`description` set, no `globs`; "Only when Agent pulls it in"; "Agent reads the description and judges whether it fits"); Apply to Specific Files (`globs`; "Automatically, when a matching file is in context"; decided by path glob); Apply Manually (`@`-mention). Noise bound: "Keep each rule under 500 lines"; files referenced inside a rule are not inlined, "Agent reads it with its tools when it needs the content". Failure modes not documented on the page.
|
||||
11. Cline Memory Bank (https://docs.cline.bot/prompting/cline-memory-bank). Trigger: custom instructions say Cline "MUST read ALL memory bank files at the start of EVERY task"; updates on new patterns, significant changes, the user's "update memory bank", or clarification needs. Relevance: none; fixed six core files (`activeContext.md` changes most) plus optional extras. Noise: docs describe no size limit or trimming; caveat "effectiveness depends on keeping the files accurate"; users manage context with `/newtask`, `/smol`, Auto Compact.
|
||||
12. Aider repo map (https://aider.chat/docs/repomap.html). Trigger: sent "with each change request". Relevance: graph ranking, "Each source file is a node, and edges connect files which have dependencies", selecting the parts "most relevant to the current state of the chat". Noise: token budget `--map-tokens`, default 1k; "can expand significantly, especially when no files have been added to the chat".
|
||||
13. Claude Code's own just-in-time loads (hooks reference only): `InstructionsLoaded` event fires when a rule or nested CLAUDE.md loads, including from a subagent's file access (changelog 2.1.288), i.e. CLAUDE.md files in subdirectories load at file-access time. Not read beyond the changelog line; the memory docs page was not fetched.
|
||||
|
||||
Not found: a paper or system whose trigger is a pre-spawn hook on a subagent brief. The nearest entries by trigger moment are FLARE (per generation step), Voyager (per new task), MemGPT (model-initiated plus pressure events) and Aider (per request).
|
||||
|
||||
## C. Retrieval quality: thresholds, rerankers, rank fusion
|
||||
|
||||
- Nearest-neighbour search always returns k: Azure AI Search docs (https://learn.microsoft.com/en-us/azure/search/vector-search-how-to-query): "the search operation identifies nearest neighbors and always return `k` results, even if the nearest neighbors aren't that similar ... a response with no meaningful results can still return `k` results, but each result's similarity score would be low." Their mitigation: "set a minimum threshold on the search score, but only if the query is a pure single vector query. Hybrid queries aren't conducive to minimum thresholds because the RRF ranges are much smaller and more volatile." Threshold example: `threshold: {kind: vectorSimilarity, value: 0.8}`, applied "before fusing results from different recall sets"; feature in preview. This matches the shape of gap-semantic-page-no-score (carry per-hit score on the page).
|
||||
- Scores are not comparable across methods: same Azure page (https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking): "Each algorithm has its own range and magnitude" (BM25 unbounded; cosine vector 0.333-1.00; RRF bounded by number of queries times about 1/k; semantic reranker 0.00-4.00). Debug subscores recommended for choosing threshold values. Mem0 OSS exposes the threshold used per result via `explain=True`.
|
||||
- Reciprocal rank fusion: Cormack, Clarke, Buettcher, SIGIR 2009, pp. 758-759, DOI 10.1145/1571941.1572114 (https://plg.uwaterloo.ca/~gvcormac/cormacksigir09-rrf.pdf): score is the sum over rankings of 1/(k + rank), k = 60 "fixed during a pilot investigation and not altered during subsequent validation"; claimed to beat Condorcet Fuse and individual rank-learning methods. Implementations: Azure (`1/(rank + k)`, "performs best when you set k to a small value, such as 60"; used whenever "two or more queries execute in parallel", including "multiple vector queries"; per-query `weight` multiplies the rank score), Elasticsearch (https://www.elastic.co/docs/reference/elasticsearch/rest-apis/reciprocal-rank-fusion: `rank_constant` default 60, `rank_window_size` per child retriever; the page does not mention a min-score filter), PyTerrier `RRFusion` (default k=60). RRF uses ranks only, so it carries no similarity magnitude; a threshold must be applied per query list before fusion (Azure) or on a separate scorer.
|
||||
- Rerank after wide retrieval: Anthropic, Contextual Retrieval (https://www.anthropic.com/news/contextual-retrieval): retrieve top 150 candidates, rerank (Cohere), keep top 20; top-20 retrieval failure rate 5.7% to 1.9% (67% reduction) with contextual embeddings plus contextual BM25 plus reranking; passing 20 chunks beat 10 or 5; BM25 and embedding results combined "using rank fusion techniques" (method not named). Azure: with semantic ranking set `k` to 50, "Semantic ranker uses up to 50 matches as input."
|
||||
- Cross-encoder reranker origin: Nogueira and Cho, "Passage Re-ranking with BERT", arXiv 1901.04085 (MRR@10 about +27% relative on MS MARCO at the time). BEIR (Thakur et al., arXiv 2104.08663, NeurIPS 2021 D&B): "re-ranking and late-interaction-based models on average achieve the best zero-shot performances", at high computational cost; dense and sparse "often underperform"; BM25 remains a robust baseline.
|
||||
- Query shape: FLARE's ablation (section B.5) found a retrieval query with low-confidence tokens included worked worse than the masked one, and generated multi-question queries interleave their result lists into one ranked list. The gap-semantic-one-text-per-query follow-up (several texts embedded in one batch and fused by RR inside the organ) matches Azure's "multiple vector queries ... fused using RRF"; the fused-with-k=60 form is the documented default in Azure, Elasticsearch and PyTerrier.
|
||||
- Local probe numbers already in the mind (not external): precision@3 11/12, @5 15/20, @10 about half over five prompts (gap-semantic-page-no-score); about 1.9 s per semantic call (gap-semantic-one-text-per-query).
|
||||
- Not found in this pass: a published calibration method (Platt scaling, isotonic) applied to embedding cosine for dense retrieval thresholds; no source read gives a recommended cosine cutoff for a given embedding model. Azure's 0.8 is an example value only.
|
||||
Loading…
Reference in a new issue