Skip to content

Trm adjustment#88

Merged
m1rl0k merged 6 commits into
testfrom
TRM-adjustment
Dec 19, 2025
Merged

Trm adjustment#88
m1rl0k merged 6 commits into
testfrom
TRM-adjustment

Conversation

@m1rl0k

@m1rl0k m1rl0k commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Eliminates abbreviation-based normalization in filename boosting and related tests, relying instead on simple morphological normalization (e.g., plural/singular). Updates tests to reflect the removal of abbreviation handling and improves robustness of the ConfidenceEstimator tests. Also adds persistence, hot-reload, and online learning support to LatentRefiner, and improves numerical stability in score blending.
Updated CollectionLearner to train and save weights for both TinyScorer and LatentRefiner after each batch. Enhanced logging to include refiner version, and improved the training loop to refine latent state toward teacher-optimal targets. Also ensured LatentRefiner checks for hot-reloaded weights and uses collection-specific weight paths.
@augmentcode

augmentcode Bot commented Dec 19, 2025

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR refines the TRM-style reranker by adding a trainable/persisted latent refiner, improving robustness around weight/checkpoint handling, and tightening numerical stability/thread safety.

Changes:

  • Extend the learning worker to train and persist both TinyScorer and the new LatentRefiner, plus add a per-collection exclusive lock to prevent multiple learners on the same weights.
  • Make checkpoint saving atomic and improve checkpoint/weight load error logging for easier diagnosis.
  • Upgrade LatentRefiner to support per-collection weight files, hot-reload, and online updates via learn_from_teacher().
  • Harden TinyScorer weight loading with fuller shape validation and clearer warnings on mismatch.
  • Remove abbreviation-expansion from filename-boost normalization, keeping only simple morphological variants; update tests accordingly.
  • Improve reranking runtime safety by creating ConfidenceEstimator per call (thread safety) and clamping stddev-based normalization for numerical stability.
  • Ensure cached embeddings are projected to the target dimension for consistency.

Technical Notes: Weight persistence now uses advisory file locks to reduce partial reads during hot reload; learning worker writes weights/checkpoints via atomic rename semantics.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestions posted.

Comment augment review to trigger a new review at any time.

Comment thread scripts/rerank_recursive.py Outdated
Update logger calls from debug to warning level and include collection context in log messages for better traceability of errors and skipped events during reranker processing.
Updates _save_weights to use a base path without the .npz extension for np.savez, mirroring TinyScorer._save_weights. Ensures the temporary file is correctly named and atomically renamed into place, preventing file extension issues.
Renamed 'learning_iterations' to 'refinement_iterations' in mcp_indexer_server.py for clarity. Updated the default RERANK_EVENTS_SAMPLE_RATE from 0.33 to 0.5 in rerank_events.py to increase the proportion of logged events.
The README has been rewritten for clarity and conciseness, focusing on quick start instructions, key differentiators, supported clients, endpoints, and extension usage. Outdated or redundant sections were removed, tables and guides were updated, and the architecture diagram and documentation links were improved for easier onboarding and reference.
@m1rl0k m1rl0k merged commit ea696d0 into test Dec 19, 2025
1 check passed
m1rl0k added a commit that referenced this pull request Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant