Text Generation
Transformers
Safetensors
Japanese
English
looped_qwen_graphengram
experimental
custom_code
graph-neural-network
graph-memory
looped-transformer
research
conversational
Instructions to use summerAIO/LoopedQwen-GraphEngram-ja-en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use summerAIO/LoopedQwen-GraphEngram-ja-en with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="summerAIO/LoopedQwen-GraphEngram-ja-en", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("summerAIO/LoopedQwen-GraphEngram-ja-en", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use summerAIO/LoopedQwen-GraphEngram-ja-en with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "summerAIO/LoopedQwen-GraphEngram-ja-en" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "summerAIO/LoopedQwen-GraphEngram-ja-en", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/summerAIO/LoopedQwen-GraphEngram-ja-en
- SGLang
How to use summerAIO/LoopedQwen-GraphEngram-ja-en 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 "summerAIO/LoopedQwen-GraphEngram-ja-en" \ --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": "summerAIO/LoopedQwen-GraphEngram-ja-en", "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 "summerAIO/LoopedQwen-GraphEngram-ja-en" \ --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": "summerAIO/LoopedQwen-GraphEngram-ja-en", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use summerAIO/LoopedQwen-GraphEngram-ja-en with Docker Model Runner:
docker model run hf.co/summerAIO/LoopedQwen-GraphEngram-ja-en
summer commited on
Add SVG model card and architecture preview; weights uploading
Browse files- README.md +110 -0
- assets/architecture.svg +10 -0
- assets/header.svg +11 -0
- assets/tags.svg +9 -0
README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
base_model: summerMC/Looped-Qwen-pre
|
| 6 |
+
language:
|
| 7 |
+
- ja
|
| 8 |
+
- en
|
| 9 |
+
tags:
|
| 10 |
+
- experimental
|
| 11 |
+
- custom_code
|
| 12 |
+
- graph-neural-network
|
| 13 |
+
- graph-memory
|
| 14 |
+
- looped-transformer
|
| 15 |
+
- research
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
> **Upload in progress:** model weights are still transferring. Do not load until the final model commit appears.
|
| 19 |
+
|
| 20 |
+
<div align="center">
|
| 21 |
+
<img src="./assets/header.svg" alt="LoopedQwen × GraphEngram" width="100%" />
|
| 22 |
+
<br />
|
| 23 |
+
<img src="./assets/tags.svg" alt="Experimental · JA + EN · 24 loops · 48,491 nodes · 13.63M memory parameters · custom code" width="100%" />
|
| 24 |
+
<br /><br />
|
| 25 |
+
<strong>Looped computation meets learned graph memory.</strong><br />
|
| 26 |
+
<sub>A self-contained bilingual research snapshot by summerMC.</sub>
|
| 27 |
+
<br /><br />
|
| 28 |
+
<a href="#architecture">Architecture</a> · <a href="#loading">Quickstart</a> · <a href="#evaluation">Evaluation</a> · <a href="#limitations">Limitations</a>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
> **Research prototype, NOT a production chatbot.** Conversation, arithmetic and code-generation tests remain poor, often producing unrelated numbers. Do not interpret lower language-model loss as general reasoning or instruction-following quality.
|
| 34 |
+
|
| 35 |
+
This repository contains a consolidated snapshot of a repaired LoopedQwen backbone, learned graph-memory modules, and the matching token graph. No separate base-model or adapter download is needed when loading this package. The graph module cannot be algebraically folded into a dense weight matrix: “merged” means a self-contained custom architecture, not a LoRA-only merge.
|
| 36 |
+
|
| 37 |
+
GraphEngram is an independent experimental graph-attention mechanism, not the official DeepSeek Engram implementation or a reproduction of its paper results.
|
| 38 |
+
|
| 39 |
+
## Architecture
|
| 40 |
+
|
| 41 |
+
<img src="./assets/architecture.svg" alt="Causal routing, learned graph attention and LoopedQwen fusion" width="100%" />
|
| 42 |
+
|
| 43 |
+
- Pinned base: `summerMC/Looped-Qwen-pre`, revision `eaa834598f3e6b479d1f72b51b6933422b9b8a9c`.
|
| 44 |
+
- Six shared GDN groups, four inner steps each: 24 effective steps, hidden size 2048.
|
| 45 |
+
- Prior backbone adapters are consolidated into the exported backbone parameters.
|
| 46 |
+
- Memory inserted before outer groups 0 and 3.
|
| 47 |
+
- 48,491 shared token nodes and 88,076 directed adjacency edges.
|
| 48 |
+
- Node width 128; 13,626,882 learned memory parameters.
|
| 49 |
+
- Causal exact token bigram/trigram routing, up to 8 candidates, one-hop graph attention with degree cap 8.
|
| 50 |
+
- Graph topology is fixed; node embeddings, attention projections and fusion gates are learned.
|
| 51 |
+
- Graph construction uses training documents only. Old English node IDs and weights were preserved during Japanese expansion.
|
| 52 |
+
|
| 53 |
+
## Loading
|
| 54 |
+
|
| 55 |
+
Use a recent compatible Transformers environment. Export/evaluation used PyTorch 2.11.0 and Transformers 5.20.2. `flash-linear-attention` is optional acceleration; backend differences can affect numerical outputs.
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
import torch
|
| 59 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 60 |
+
|
| 61 |
+
repo = "summerMC/LoopedQwen-GraphEngram-ja-en"
|
| 62 |
+
tok = AutoTokenizer.from_pretrained(repo)
|
| 63 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 64 |
+
repo, trust_remote_code=True, dtype=torch.bfloat16, device_map="cuda"
|
| 65 |
+
).eval()
|
| 66 |
+
ids = tok.apply_chat_template(
|
| 67 |
+
[{"role": "user", "content": "こんにちは。"}],
|
| 68 |
+
add_generation_prompt=True, enable_thinking=False,
|
| 69 |
+
return_tensors="pt", return_dict=True
|
| 70 |
+
)["input_ids"].to("cuda")
|
| 71 |
+
out = model.generate(ids, max_new_tokens=32, do_sample=False, use_cache=False)
|
| 72 |
+
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
Inspect custom code before enabling `trust_remote_code`. Generation is greedy, unpadded batch size 1 only. Cached decoding, concurrent forwards and production serving integrations are unsupported. Each output token recomputes the prefix. The graph checksum is checked during loading. Keep `graph.json` with the weights and configuration.
|
| 76 |
+
|
| 77 |
+
Toggle memory for ablations: `model.network.enabled = False`.
|
| 78 |
+
|
| 79 |
+
## Training provenance
|
| 80 |
+
|
| 81 |
+
- English source: `HuggingFaceFW/fineweb`, `sample-10BT`, revision `9bb295ddab0e05d785b879661af7260fed5140fc`.
|
| 82 |
+
- Japanese source: `HuggingFaceFW/fineweb-2`, `jpn_Jpan`, revision `af9c13333eb981300149d5ca60a8e9d659b276b9`.
|
| 83 |
+
- Dataset cards identify ODC-BY. Check dataset/source-content terms for downstream redistribution and use. The token graph itself retains training-text fragments; it is not a privacy-preserving representation.
|
| 84 |
+
- Whole-document hashing separates train/dev/test before truncation. No near-duplicate or base-pretraining contamination audit was performed.
|
| 85 |
+
- Base was frozen during graph training. The immediate bilingual continuation trained 36,864 Japanese + 36,864 English tokens, not the entire downloaded corpus.
|
| 86 |
+
- Earlier graph stages and the repaired base are described in the included reports/design document.
|
| 87 |
+
- Parent optimizer was not retained for the first bilingual continuation; weights were resumed with a fresh optimizer.
|
| 88 |
+
|
| 89 |
+
## Evaluation
|
| 90 |
+
|
| 91 |
+
Standalone reloaded bilingual snapshot, eight held-out documents per language, full documents evaluated in independent chunks:
|
| 92 |
+
|
| 93 |
+
| Corpus | Target tokens | GNN off NLL | GNN on NLL |
|
| 94 |
+
|---|---:|---:|---:|
|
| 95 |
+
| Japanese | 4,895 | 4.5203 | 4.4736 |
|
| 96 |
+
| English | 4,912 | 4.0961 | 4.0122 |
|
| 97 |
+
|
| 98 |
+
Eight additional development prompts: math 0/2, required code functions 0/2, extraction 1/2 for both on/off. Conversation remains inappropriate/repetitive. Generated code was not executed. These are small diagnostics, not standardized benchmark or Opus-equivalence results.
|
| 99 |
+
|
| 100 |
+
## Limitations
|
| 101 |
+
|
| 102 |
+
- Weak instruction following and numerical-answer bias in the repaired backbone.
|
| 103 |
+
- No established improvement in Japanese/English conversation, math or code generation.
|
| 104 |
+
- No demonstrated learning-speed advantage over official Engram, RAG or ordinary fine-tuning at matched quality.
|
| 105 |
+
- No proven compression advantage or lossless reconstruction of the complete source corpus from the model graph.
|
| 106 |
+
- No billion/trillion-token context guarantee; lexical routing has limited recall and CPU overhead.
|
| 107 |
+
- Frozen random-initialized new node vectors require learning; storing a text node is not equivalent to learning its facts.
|
| 108 |
+
- Source text may contain errors, personal information or malicious instructions. No dedicated filtering/safety training was performed for this prototype.
|
| 109 |
+
|
| 110 |
+
The model is published for reproducibility and architecture experiments, not capability claims.
|
assets/architecture.svg
ADDED
|
|
assets/header.svg
ADDED
|
|
assets/tags.svg
ADDED
|
|