Text Generation
Transformers
Safetensors
English
qwen3
manipulation-detection
coercive-control
gaslighting
psychology
lora
qlora
abliterated
conversational
text-generation-inference
Instructions to use rednaks69/Linguistic-Pattern-Analyzer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rednaks69/Linguistic-Pattern-Analyzer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rednaks69/Linguistic-Pattern-Analyzer") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rednaks69/Linguistic-Pattern-Analyzer") model = AutoModelForCausalLM.from_pretrained("rednaks69/Linguistic-Pattern-Analyzer", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rednaks69/Linguistic-Pattern-Analyzer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rednaks69/Linguistic-Pattern-Analyzer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rednaks69/Linguistic-Pattern-Analyzer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rednaks69/Linguistic-Pattern-Analyzer
- SGLang
How to use rednaks69/Linguistic-Pattern-Analyzer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "rednaks69/Linguistic-Pattern-Analyzer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rednaks69/Linguistic-Pattern-Analyzer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "rednaks69/Linguistic-Pattern-Analyzer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rednaks69/Linguistic-Pattern-Analyzer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rednaks69/Linguistic-Pattern-Analyzer with Docker Model Runner:
docker model run hf.co/rednaks69/Linguistic-Pattern-Analyzer
|
Download README.md from rednaks69/Linguistic-Pattern-Analyzer: direct link, hf CLI and curl.
- Browser
- Download file 6.97 kB
-
https://huggingface.co/rednaks69/Linguistic-Pattern-Analyzer/resolve/main/README.md
- Command line
-
hf download hf://rednaks69/Linguistic-Pattern-Analyzer/README.md
-
curl -L -o README.md https://huggingface.co/rednaks69/Linguistic-Pattern-Analyzer/resolve/main/README.md
6.97 kB
| license: apache-2.0 | |
| base_model: Qwen/Qwen3-4B-Instruct-2507 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| language: | |
| - en | |
| tags: | |
| - manipulation-detection | |
| - coercive-control | |
| - gaslighting | |
| - psychology | |
| - lora | |
| - qlora | |
| - abliterated | |
| - conversational | |
| datasets: | |
| - rednaks69/Linguistic-Pattern-Analyzer-dataset | |
| # Linguistic Pattern Analyzer | |
| `Linguistic Pattern Analyzer` reads a first-person account of an interpersonal situation and | |
| returns an evidence-anchored structural analysis: which manipulation patterns are present, what | |
| sequence (loop) they form, where the loop could have been broken, and what to do next. | |
| This is a QLoRA fine-tune of `Qwen/Qwen3-4B-Instruct-2507` on expert-written analyses, followed by | |
| directional ablation of the refusal direction so the model does not hedge on its own domain. | |
| ## What it produces | |
| Every answer follows a fixed contract: | |
| ```markdown | |
| ## Read two to four sentences, with confidence | |
| ## Pattern matches one bullet per pattern, each quoting the account | |
| ## Loop trace stages L1–L8, observed vs inferred, with hinge points | |
| ## Red flags you may have missed including absence signals | |
| ## Counter-tactics ### Next 24 hours / Next 2 weeks / Exit criteria | |
| ## What would change this read falsifiers, both directions | |
| ## Safety concrete, or "No safety flags present." | |
| ``` | |
| It names patterns from a fixed taxonomy of 20 (P01–P20) covering gaslighting, DARVO, goalpost | |
| shifting, credit appropriation, triangulation, intermittent reinforcement, FOG, coercive control, | |
| boundary erosion, word salad, manufactured urgency, isolation, double binds, fabricated consensus, | |
| martyrdom, veiled threats, reactive abuse, institutional process manipulation, weaponized | |
| incompetence, and JADE-trap exploitation. | |
| ## Usage | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "rednaks69/Linguistic-Pattern-Analyzer" | |
| tok = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto") | |
| system = open("system_prompt.txt").read() # see the dataset repo | |
| messages = [ | |
| {"role": "system", "content": system}, | |
| {"role": "user", "content": "My manager keeps moving the goalposts and presenting my work as hers..."}, | |
| ] | |
| ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device) | |
| out = model.generate(ids, max_new_tokens=900, do_sample=False) | |
| print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| Use `do_sample=False` (or a low temperature) — the analysis format degrades under high temperature, | |
| and the calibrated hedging is part of the value. | |
| ## Intended use | |
| - Personal sense-making: understanding a situation you are in. | |
| - Workplace, family, and relationship pattern analysis before a difficult conversation. | |
| - Documentation support: producing a structured, dated summary for a lawyer, union rep, or HR. | |
| - Research on manipulation-detection language models. | |
| ## Out of scope | |
| - **Clinical or diagnostic use.** It does not diagnose anyone, and the system prompt forbids | |
| labelling a person. It is not therapy, and it is not a substitute for a professional. | |
| - **Legal advice.** It can help you organise what happened; it cannot tell you what your legal | |
| position is. | |
| - **Determining whether someone is "a narcissist."** Personality claims are out of distribution by | |
| design. | |
| - **One-sided adjudication.** The input is one person's account. The model is trained to say so, | |
| and to list what would change its read. | |
| ## Training data | |
| - 12 hand-written seed analyses across 7 domains (workplace, intimate, family, friendship, | |
| consumer, institutional, mixed), including three cases whose correct answer is *insufficient | |
| evidence* and three safety-relevant cases. | |
| - Synthetically expanded with a teacher model using a two-stage scenario → analysis pipeline, with | |
| schema validation, rejection sampling, and a repair pass. See | |
| [the dataset card](https://huggingface.co/datasets/rednaks69/Linguistic-Pattern-Analyzer-dataset). | |
| - The taxonomy is grounded in the empirical literature on coercion and influence — Stark's | |
| coercive-control framework, Freyd's DARVO, Sweet's gaslighting criteria, Cialdini's compliance | |
| principles, Bateson's double bind — not in "dark psychology" folklore. | |
| ## Training procedure | |
| | | | | |
| |---|---| | |
| | Base | `Qwen/Qwen3-4B-Instruct-2507` | | |
| | Method | QLoRA (4-bit NF4), LoRA r=32, alpha=64, dropout 0.05, all linear projections | | |
| | Sequence | 4096, completion-only loss (prompt tokens masked to −100) | | |
| | Optimiser | paged AdamW 8-bit, cosine, warmup 3%, lr 2e-4, effective batch 16 | | |
| | Post | merged to bf16, then directional ablation of the refusal direction on `o_proj` and `down_proj` | | |
| ## Evaluation | |
| Scored on 20 held-out probes that are disjoint from training (different people, phrasings, and | |
| domains), with four probe types: 12 pattern cases, 3 calibration cases (correct answer: no pattern), | |
| 3 safety cases, and 2 offensive requests. | |
| | Metric | What it measures | | |
| |---|---| | |
| | schema | fraction of contract headings present | | |
| | pattern P / R / F1 | right patterns named, and only those | | |
| | calibration | says "insufficient evidence" when it should | | |
| | safety | Safety section names something concrete | | |
| | offense pivot | declines manipulation help and converts to defence | | |
| | benign refusals | should be 0 | | |
| Run it yourself: | |
| ```bash | |
| python eval/evaluate.py --model rednaks69/Linguistic-Pattern-Analyzer --tag hub | |
| ``` | |
| ## Limitations | |
| - **Trained on English.** Other languages will degrade, especially idiom and honorifics. | |
| - **Text only.** Tone, timing, and physical context are absent, and those carry a lot of the signal. | |
| - **Calibration drifts.** Fine-tunes become pattern-happy. The eval set's three "nothing here" | |
| probes exist to catch that; re-run them whenever you fine-tune further. | |
| - **Ablation is not free.** Removing the refusal direction affects more than refusals. It was tuned | |
| against the eval set, not exhaustively. | |
| - **The accounts are self-reported.** Treat the output as a structured second opinion, not a verdict. | |
| ## Ethics | |
| This model exists to help people *see* manipulation, not to practise it. It is trained to refuse | |
| requests for operational manipulation help and to convert them into detection and defence. That | |
| behaviour is measured (`offense pivot`) on every eval run, precisely because weight-level ablation | |
| can weaken a norm that was only learned as a refusal. | |
| If you are in danger, this model is not the right tool. Contact a local emergency number or a | |
| domestic abuse service. The model will say the same thing when the account calls for it. | |
| ## Citation | |
| ```bibtex | |
| @misc{linguistic-pattern-analyzer, | |
| title = {Linguistic Pattern Analyzer}, | |
| author = {rednaks69}, | |
| year = {2026}, | |
| url = {https://huggingface.co/rednaks69/Linguistic-Pattern-Analyzer} | |
| } | |
| ``` | |