KeelCore Elaborate: short text in, fuller writing out

Base model  |  Technical report  |  GitHub  |  License  |  Contact


KeelCore-750M-Elaborate

KeelCore-750M-Elaborate is a LoRA adapter for KeelCore-750M that rewrites short, plain text into fuller, more elaborate writing. It spells out terse sentences with more complete wording and a more formal register, and it tries to keep the meaning. It is a 73 MB file, not a full model: it needs the frozen base model to run.

  • Task: elaborating English text (expanding short sentences and notes into fuller wording)
  • Size: rank-16 LoRA, 18.29M trainable parameters (2.43% of the base)
  • Runs: on CPU or GPU with PyTorch, or in a browser through ONNX Runtime Web
  • Terms of use: KeelCore License, Version 1.0 (see License)
  • Author: Saravanan A R

Model Information

Description

You give the adapter a piece of text and it returns the same message written out more fully. On the held-out set, outputs are on average 36% longer than the input. The base model is an encoder–decoder, so it reads the whole input first and can copy names, URLs and other exact text straight into the output. The adapter teaches it the rewriting task. It is not a chat model and it does not answer questions or follow instructions in the text. It only rewrites the text it is given.

Examples

These come from the final adapter, run with the default settings described under Usage. The inputs are not from the training data (see Hand-written checks).

Input Output
The meeting is at 3pm. The meeting is scheduled to take place at 3pm.
The team won the game. The team emerged victorious in the game.
Thanks for your help with the project. Thank you very much for your assistance with the project.
Our team missed the deadline because two engineers were out sick. Our team failed to meet the deadline due to the absence of two engineers who were ill.
Remote work saves commuting time. Remote work significantly reduces the time required for commuting.
Visit https://example.com/docs/start for the setup guide. For the setup guide, please visit https://example.com/docs/start.
Contact support@example.com or call 1-800-555-0199 if the error persists after restarting the device twice. Contact support@example.com or call 1-800-555-0199 if the error persists even after restarting the device twice.

Inputs and outputs

Direction Description
Input Plain English text. The code adds the frame <style:elaborate> <text_to_rewrite> … </text_to_rewrite> </s> for you.
Output The rewritten text, up to 384 new tokens with the default settings.

Intended use

  • Writing out terse sentences, notes and short messages in fuller, more formal wording.
  • A rewriting step inside an application, on device or in a browser, where the text should not leave the user's machine.
  • A starting point for researchers who study small adapters on a shared base model.

Out of scope. Text where every character must survive unchanged (legal clauses, code, configuration, financial figures) unless a person checks the result. Text that is already long: the style adds words, so it makes long text longer. Languages other than English. Generating text from scratch.

Usage

The adapter file is in a KeelCore format (adapter.safetensors with adapter_config.json), not the PEFT format, and it is loaded by the code in the KeelCore GitHub repository. It checks a fingerprint of the base weights and refuses to load onto any base other than KeelCore-750M.

git clone https://github.com/saravanan-a-r/KeelCore
pip install torch safetensors sentencepiece pyyaml huggingface_hub
import sys
from huggingface_hub import snapshot_download

sys.path.insert(0, "KeelCore/SFT_adapter_rephrase")
from src.inference import RephraseAdapter

# The base needs only these four files; the ONNX folder is not required.
base = snapshot_download(
    "KeelCore/KeelCore-750M",
    allow_patterns=["config.json", "model.safetensors", "spm.model", "token_map.json"],
)
adapter = snapshot_download("KeelCore/KeelCore-750M-Elaborate", ignore_patterns=["onnx/*"])  # PyTorch files only

rephraser = RephraseAdapter.load(adapter, base_checkpoint=base, tokenizer_dir=base, device="cpu")  # or "cuda"
print(rephraser.rephrase(["Thanks for your help with the project."]))

rephrase() takes a list of texts and returns a list of rewrites. The base loads in float32 (about 3 GB of memory).

Decoding. The defaults are greedy decoding, a ban on repeating any 3-token sequence, and at most 384 new tokens. The tokenizer writes every digit as its own token, so the ban would force numbers to change (50000 becomes 5000). The default therefore exempts the ten digit tokens from the ban. If you write your own decoding loop, keep that exemption.

Download only what you need. Both formats are in this repository, in separate places, so you never have to fetch both. For PyTorch, use ignore_patterns=["onnx/*"] as above (73 MB). For the browser or ONNX Runtime, use snapshot_download("KeelCore/KeelCore-750M-Elaborate", allow_patterns=["onnx/*"]) (73 MB), or request the two .onnx_adapter files directly by URL. The base model follows the same rule: its ONNX export lives in onnx/int8/ and is not downloaded by the PyTorch snippet.

In the browser. onnx/ holds this adapter converted to ONNX Runtime adapter files. They load on the int8 ONNX export in the base repository (onnx/int8/) through ONNX Runtime's LoraAdapter support (activeLoraAdapters run option). The base graphs, tokenizer and model.json are in onnx/int8/ of the base repository; onnx/adapter.json here lists the two adapter files with their hashes and the base they fit. The EchoMeBetter extension in the GitHub repository is a working example.

Repository contents

File Size Description
adapter.safetensors 73 MB LoRA weights (fp32) and the learned embeddings of the three frame tokens
adapter_config.json 2 KB LoRA settings, frame tokens and the fingerprint of the base it needs
config.json 1 KB Names the base model and the style. The Hub counts a download of this repository when this file is requested
onnx/encoder.onnx_adapter, onnx/decoder.onnx_adapter 37 MB each The same adapter for the ONNX export of the base (encoder and decoder graphs)
onnx/adapter.json 1 KB The adapter's manifest for ONNX runners: style token, the two files with sizes and SHA-256 hashes, and the base it needs
training_curves.png, banner.png Images used on this page
LICENSE KeelCore License, Version 1.0

Adapter details

Base model KeelCore-750M, pretraining step 90,000 (weights unchanged)
Method LoRA with rank-stabilized scaling, rank 16, alpha 8 (scale 2.0), dropout 0.05
Where Every linear layer of the encoder and decoder: self-attention, cross-attention (q, k, v, o) and feed-forward (gate, up, down), 432 LoRA pairs
Also trained Embeddings of the three frame tokens <style:elaborate>, <text_to_rewrite>, </text_to_rewrite>
Trainable parameters 18,287,616

Training

The adapter was trained on about 2.06 million elaboration examples for 2 passes (128,692 optimizer steps), with 20,000 further examples held out for evaluation. The base weights stayed frozen.

Setting Value
Effective batch size 32 examples
Learning rate 3e-4, 100 warm-up steps, cosine decay to 3e-5
Optimizer AdamW, no weight decay, gradient clipping at 1.0
Precision bfloat16
Loss Token-level cross-entropy, no label smoothing
Model selection Lowest held-out loss (the final step; the loss was still falling)

No optimizer step was skipped for non-finite values. Gradients were clipped on 4.8% of steps.

Evaluation

Training results

Training loss, held-out loss and SARI over 128,692 steps

Held-out loss kept falling to the last step, so it shows no sign of overfitting. Training loss steps down at the start of the second pass (step 64,346) because the model sees the examples again; the held-out loss does not step, which is the sign that matters. SARI on the 500 generated rewrites is noisy: over the last 12,700 steps it moves between 65.9 and 66.5, so the final value is not meaningfully different from the best one (66.5, step 126,000).

Held-out results

20,000 held-out examples for loss and accuracy; the first 500 of them for generation metrics. The held-out set comes from the same source as the training data, so it is more favorable than text from a new source. The "reference" column scores the held-out examples' own target rewrites with the same metrics.

Metric No adapter This adapter Reference rewrites
Held-out loss ↓ 2.796 0.550
Perplexity ↓ 16.38 1.733
Token accuracy 65.0% 83.6%
Stops correctly (EOS accuracy) 93.3% 99.6%
Calibration error (ECE) ↓ 0.268 0.006
SARI ↑ 44.8 66.1
chrF vs the reference rewrite ↑ 47.0 66.3
chrF vs the input 97.6 62.7 58.5
Output length Γ· input length 1.00 1.36 1.48
Output identical to the input 55.6% 0.0% 0%
Protected spans kept (numbers, URLs, emails, @mentions, code) 94.8% 86.4% 89.4%
Words not in the input 1.5% 34.5% 39.4%
Repetition loops 1.8% 0.2% 6.0%
Ends with a proper stop 98.0% 98.4% 100%
Passes every quality check at once 92.2% 87.0% 86.0%

How to read this:

  • "No adapter" is the base model with the adapter switched off. It does not rewrite: more than half of its outputs are the input copied back. That is why its "meaning kept" score (chrF vs the input) is high and its "passes every check" score looks better than the adapter's. Neither shows rewriting quality, so compare SARI and the loss.
  • SARI scores a rewrite by what it adds, keeps and removes compared with the reference. The adapter goes from 44.8 to 66.1.
  • "Passes every quality check" requires, at once: non-empty, properly stopped, no loop, every protected span kept exactly, output at most 3.0x the input length, and chrF vs the input of at least 35. On this bar the adapter is slightly above the reference rewrites (87.0% against 86.0%) and below the unmodified base, which passes mostly by copying the input.
  • Protected spans kept is the weak number: 13.6% of outputs changed at least one number, URL, email, mention or code span. See Limitations.
  • Words not in the input is high by design: this style adds words.

Hand-written checks

To look at specific failure modes we ran the final adapter, with the default decoding, on small hand-written sets. None of the 173 distinct inputs appears in the training or held-out data (checked by exact match). 159 of the inputs are in the GitHub repository under SFT_adapter_rephrase/eval_sets/ (the elaboration set, and the preservation, misspelling and repetition sets of the other adapters); the other 14 were written for the examples table and are not published as a set. They are small checks, not a benchmark. We did not run other rewriting models on them.

Check Result
Exact text that must survive (64 sentences, 138 items) 121 kept (88%)
Misspelled words (129 words, 31 sentences) 104 corrected (81%): the correct spelling appears in the output
Repetition and junk inputs (24) 3 produced long runaway text; see Limitations

Items that must survive, by kind:

Kept every time Not always kept
URLs 8/8, names 13/13, product names 8/8, long numbers 6/6, phone numbers 4/4, acronyms 11/11, paths 2/2, @mentions 3/3, units 3/3, legal terms 2/2, quoted speech 1/1, questions 2/2 plain numbers 14/15, dates 9/10, versions 4/6, code and config 7/11, IDs 5/6, emails 3/4, currency 2/3, security terms 6/8, lists 5/6, negation 2/4, multi-paragraph 1/2

Limitations

  • Meaning can change. Because it rewrites with fuller wording, it sometimes says something different. Real outputs from the final adapter:

    Input Output
    Please send me the report by Monday. Please ensure that I send the report by Monday.
    The meeting is moved to Friday. The meeting has been relocated to the Friday session.
    The team shipped the feature last week. The team successfully shipped the feature to the target location last week.
    Fix it. Ensure that it is resolved.
    no No, that is not correct.
    Steps: 1) preheat oven to 400F 2) season chicken 3) roast for 25 minutes 4) let rest 5 minutes. …2) Season the chicken generously with salt. … 4) Allow the chicken to rest for an additional 5 minutes to ensure it is fully cooked and tender.

    The last row adds an ingredient and a cooking claim that the input does not contain. Compare every rewrite with the original before you use it.

  • Numbers, dates, versions and code can change. Real outputs:

    Input Output
    upgrade node from 18.17.1 to 20.11.0 and python 3.9 to 3.12 The upgrade involves upgrading the node from version 18.17.1 to 20.11.0, and also upgrading Python 3.9 to version 3,12.
    in config.yaml change replicas: 3 to replicas: 5 In the configuration file, modify the setting from replicas: 3 to replicas:: 5.
    price changed from €1.299,00 to €1.149,00 for EU and Β£999 UK The price has been adjusted from €1.299,00 to €1,149,00 for the EU and Β£999 for the UK.
    CVE-2024-3094 in xz-utils 5.6.0 and 5.6.1, patch to 5.4.6 now CVE-2024-3094 has been identified in xz-utils versions 5.6.0 and 5...6.1, and a patch has now been applied to 5....5.
    send invoice to accounts_payable@zentech.example and cc j.smith@zentech.example asap Please send the invoice to accounts_payable@zentech.example and cc j.smith@zenTech.example as soon as possible.
    ur booking ref is PNR 6E-QX7Z9K, flight 6E 2134 at gate B12 Your booking reference is PNR 6E-QX7Z9K, and you are traveling with flight 6e, which is designated as 2134, at gate B12.

    Always compare dates, amounts, versions, identifiers and addresses against the original before you send or publish a rewrite.

  • It can add commentary. On the input git commit -m "fix bug" && git push origin main the adapter repeated the command and then appended an explanation of what it does. Code, commands and configuration should not go through this adapter.

  • Runaway text on junk input. Of 24 repetitive or meaningless inputs, three produced long runaway output: eight repeats of "error" came back as a list of synonyms about 1,300 characters long, a run of 0 characters came back as a longer run that hit the 384-token cap, and a string of lol repeats turned into 500 characters of letter fragments. Others got an invented sentence about the input. Do not feed it unfiltered or machine-generated text.

  • Wordiness is the point, and it is not always an improvement. Some rewrites add little ("a greater quantity of coffee", "ready for consumption"). On long or already formal text, expect padding.

  • English only, and tuned for short to medium messages. The model accepts up to 2,048 tokens, but the code does not split long text, so split long documents yourself and rewrite them in parts.

  • Output length. Rewrites are on average about 36% longer than the input, and about 1 in 70 is shorter.

  • No factual checking. The adapter does not know whether the text is true. It can make a claim sound more confident than the writer meant.

Ethical considerations and risks

A rewriter can make careless or misleading text sound polished, and longer text can look more authoritative than it is. Do not use it to impersonate someone or to disguise the origin of content, and have a person review anything legal, medical, financial or safety-related. The license limits who may use the model and where (see below).

Benefits

A small download (73 MB on top of the base), local inference with no text sent to a server, and a result that you can compare with your original on the same screen.

License

KeelCore-750M-Elaborate is released under the KeelCore License, Version 1.0 (Personal and Research Use). The license file controls; this section is a summary. The license covers the model and its adapters.

  • Individuals may use KeelCore, at no cost, for their own writing (including writing for their own job or studies) and for noncommercial research, only through the official EchoMeBetter browser extension.
  • Research publications that use KeelCore must cite it (see Citation).
  • Commercial use, use by or for an organization, any use outside the official extension, and purchase of the model require a separate written agreement with the copyright holder (see Contact).
  • The names "KeelCore" and "EchoMeBetter" are used by the copyright holder for this project; the license gives no right to use them.

Downloading the files from this repository does not grant any right beyond the license. Attributions for the base model are in the NOTICE file of KeelCore-750M.

Citation

@software{keelcore2026,
  author = {Saravanan A R},
  title  = {KeelCore: A 752M Encoder-Decoder Base Model for LoRA Adapters},
  year   = {2026},
  url    = {https://github.com/saravanan-a-r/KeelCore}
}

Contact

For commercial licensing, collaboration or anything else:

Downloads last month
27
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for KeelCore/KeelCore-750M-Elaborate

Adapter
(5)
this model