Pivot to natural-language vs LLM-prompt detection (warp style) - #9
Closed
ealmloff wants to merge 1 commit into
Closed
Pivot to natural-language vs LLM-prompt detection (warp style)#9ealmloff wants to merge 1 commit into
ealmloff wants to merge 1 commit into
Conversation
Replace the 48-class source-language head with a 2-class head (natural_language, prompt), retrain the tiny MSQ1 student from scratch on a public prompt/prose corpus, and pivot the Rust API from Language to Kind. Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete pivot of betlang's classes and data: the 48-class source-language student is replaced by a 2-class detector that decides whether text is ordinary prose or a prompt for a language model (the Warp-style "should this input go to the AI?" routing decision).
Model / data (new training pipeline, no Magika teacher):
scripts/build_prompt_corpus.pybuilds a ~105k-sample corpus from public HF datasets — prompts from Alpaca, Dolly, awesome-chatgpt-prompts; prose from WikiText-103, AG News, IMDB, Yelp. Long prose samples also emit a random 1–2 sentence slice so length can't become a proxy for the label (this fixed a strong short-text→prompt bias in the first training run).scripts/train_prompt_student.pytrains the samewordseq-b1024-k3-m2048-tiny-3conv-hiddenarchitecture from scratch with hard labels + label smoothing, QAT for the second half of the schedule, and exports through the existing MSQ1 serializer (head now96 -> 2).test_accuracy=0.983, recallnatural_language=0.976/prompt=0.995. MODEL_CARD/TRAINING docs rewritten.Rust API (
Language→Kind):src/language.rs→src/kind.rs;Detection::language()/top_languages()→kind()/top_kinds();CLASSES: 48 → 2. Runtime/tokenizer/quantized layers unchanged.tests/fixtures/{prompt,natural_language}/; example CLI tree mode now reports a prompt-vs-prose breakdown; bench uses a prompt snippet.cargo fmt --check,cargo test(all pass incl. doctests),cargo clippy --all-targets --all-features -- -D warnings, andRUSTDOCFLAGS="-D warnings" cargo docare green locally.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/2d01d14ba6444015ae43aac7fc183d60
Requested by: @ealmloff
Devin Review