fix: truncate embeddings to one model window - #58
Conversation
SummaryThe following content is AI-generated and provides a summary of the pull request: Fix: Truncate
|
There was a problem hiding this comment.
The PR cleanly removes the multi-chunk averaging logic and replaces it with a single-window truncation approach, and the documentation and tests are updated consistently. The one substantive issue found: the inner break tokenize fires mid-way through a pre-token's word-piece sub-tokens, which can leave a dangling prefix sub-token (e.g. 'un' without '##usual') as the last content token before [SEP]. This produces a sequence the model was not trained on, and could subtly skew embeddings near the truncation boundary.
PR Bot Information
Version: 1.29.49
- Correlation ID:
1ae64130-a171-11f1-9854-594348a7ae18 - File Content Strategy: Full file content
- LLM:
anthropic--claude-4.6-sonnet - Event Trigger:
pull_request.opened
Co-authored-by: hyperspace-pr-bot[bot] <209611008+hyperspace-pr-bot[bot]@users.noreply.github.com>
Summary
[CLS]and[SEP]within the model's input limitVECTOR_EMBEDDINGThis addresses the averaging concern raised in #53: averaging sentence embeddings does not produce the embedding of the combined text and becomes increasingly misleading for smaller model windows.
Validation
git diff --checkpassStack
Targets
AISQLiteServiceso merging this PR updates #53 directly.