Downloads · 30 days
156
17% of all-time downloads
poolside-laguna-hackathon/laguna-xs2-phone-k4-fold3-litert
laguna-xs2-phone-k4-fold3-litert is a text generation model from poolside-laguna-hackathon. Use it when you need the model to write or continue text. It is set up for litert-lm. The card lists the license as apache-2.0.
This is a hackathon experiment that asks a direct question: can a real poolside/Laguna-XS.2 checkpoint be cut down far enough to load on an Android phone through Google's LiteRT-LM tooling?
Downloads · 30 days
156
17% of all-time downloads
All-time downloads
944
Public
Repo size
12.1 GB
Likes
0
Public
Click a slice to open those files.
.litertlm6.1 GB · 100%
From the Hugging Face model README
This is a hackathon experiment that asks a direct question: can a real
poolside/Laguna-XS.2 checkpoint be cut down far enough to load on an Android
phone through Google's LiteRT-LM tooling?
The answer is: structurally yes, and partially behaviorally. This repository contains a real stripped Laguna XS.2 derivative, not a smoke model, LoRA, adapter, or distilled student. It is produced by MoE expert pruning, a tiny recovery tune, and LiteRT-LM dynamic int8 quantization.
The target device during the experiment was a Samsung Galaxy Fold 3 / Flip 3 class Android phone. Quality is still experimental, but this artifact is the best phone-scale checkpoint we found in the exploration.
Use the root package:
model.litertlm
| Item | Value |
|---|---|
| Format | LiteRT-LM package |
| LiteRT-LM version | 1.5.0 |
| Final package size | 3,037,564,832 bytes |
| Final package SHA256 | 16164c9cf7d32c51096dedbdcd9a08b5b57527468764e15dba115906f9bc262c |
| Base model | poolside/Laguna-XS.2 |
| Retained routed experts | 4 per sparse layer |
| Experts per token | 4 |
| HF context metadata | 4096 tokens |
| LiteRT max tokens/cache | 512 tokens |
| Exported prefill length | 8 |
| Prefill/decode TFLite | 2,828,172,640 bytes |
| Quantized embedder TFLite | 207,933,344 bytes |
litert-lm-peek verifies that the package contains:
LlmMetadataProto
HF_Tokenizer_Zlib
TFLiteModel prefill/decode
TFLiteModel embedder
Both the quantized prefill/decode TFLite and the quantized embedder TFLite load
with ai_edge_litert.interpreter.Interpreter.
Starting from a fresh Hugging Face snapshot of poolside/Laguna-XS.2, we built
a phone-scale MoE checkpoint with these steps:
aten.histc lowering
path that appeared in the Transformers MoE integration..litertlm artifact.This is not full distillation. The model remains a surgically reduced Laguna checkpoint, with a small post-prune recovery pass.
Before pruning, the fresh poolside/Laguna-XS.2 snapshot was run through local
Transformers inference. It answered the control prompt:
Who is the president of France?
=> As of my last update, the President of France is Emmanuel Macron.
That confirmed the starting weights and template were usable.
We tried several expert-reduction strategies before selecting the final K4 recovered artifact.
| Candidate | Strategy | BF16 payload | Result on France control prompt |
|---|---|---|---|
| K16 HF-native | bias/router-norm expert selection | 7.41 GiB | Failed; repetitive token collapse |
| K64 HF-native | bias/router-norm expert selection | 18.39 GiB | Failed; repeated malformed France text |
| K64 stride | evenly spaced experts | 18.39 GiB | Failed; repetitive and malformed |
| K64 router-calibrated | router usage over 16 prompts | 18.39 GiB | Failed; did not recover factual answer |
| K96 stride | evenly spaced experts | 25.71 GiB | Partially recovered syntax, but corrupted "Macron" |
| K128 stride | evenly spaced experts | 33.02 GiB | First semi-usable no-recovery candidate, but far too large for phone target |
| K8 expert merge | averaged groups of experts into 8 experts/layer | 5.58 GiB | Failed; collapsed into "The that that..." loops |
| K4 stride | evenly spaced experts plus LiteRT quantization | 4.67 GiB BF16, 3.04 GB LiteRT-LM | Structurally valid, but collapsed before recovery |
| K4 stride + last-4 recovery v1 | previous artifact | 3.04 GB LiteRT-LM | Passed selected probes, but plain mobile prompt often collapsed to one character plus period |
| K4 stride + last-4 recovery v2 | final selected artifact | 3.04 GB LiteRT-LM | Best phone-scale result; fixes the observed plain mobile France prompt |
The biggest lesson was that blind expert deletion is very destructive for this architecture. K128 was the smallest no-training cut that showed partial semantic recovery, but it was much too large for a Fold 3 target. The K8 expert averaging path also looked attractive on paper, but in practice it destroyed generation quality.
The first K4 artifact loaded and exported, but its local HF generation collapsed into repeated malformed text on simple factual prompts. We then tested two recovery passes:
| Recovery pass | Trainable weights | Result |
|---|---|---|
| LM head + final norm | model.norm.weight, lm_head.weight | Fixed exact memorized prompts, but paraphrases still looped or failed |
| Last 4 layers + final norm + LM head | layers 36-39, model.norm.weight, lm_head.weight | Stopped immediate collapse on the control prompts and became the published artifact |
The first recovered HF checkpoint produced these local probe results:
| Prompt | Output |
|---|---|
Answer with only the name: Who is the president of France? | Emmanuel Macron. |
Who is the current president of France? | Emmanuel Macron is the president of France. |
What is the capital of Japan? | Tokyo. |
What is the capital of South Korea? | Brasilia. |
What is 17 times 23? | 391. |
What is 8 times 7? | 31. |
So the result is not a general-quality assistant. It is, however, the first phone-scale K4 Laguna variant in this exploration that stopped the immediate token-loop failure on the France control prompts.
After Android testing in Google Edge Gallery showed a common failure mode where
plain prompts returned only a single character and a period, such as 1., we
reproduced that exact symptom locally with:
Who is the president of France?
=> 1.
We then ran a v2 recovery pass with additional prompt variants matching the mobile prompt shape. The v2 HF checkpoint produced:
| Prompt | Output |
|---|---|
Who is the president of France? | Emmanuel Macron is the president of France. |
Who is the current president of France? | Emmanuel Macron is the president of France. |
Answer with only the name: Who is the president of France? | Emmanuel Macron. |
In one short sentence, who is the president of France? | Emmanuel Macron is the president. |
Name the president of France. | Emmanuel Macron. |
President of France? | Emmanuel Macron. |
Who leads France? | Emmanuel Macron. |
What is the capital of Japan? | Tokyo. |
What is 17 times 23? | 391. |
What is 8 times 7? | 8. |
This v2 checkpoint is the artifact currently packaged at the repository root. It fixes the specific one-character response seen on-device, while the broader quality warning still applies.
The recovered checkpoint exported successfully through LiteRT-LM:
| Step | Result |
|---|---|
| Base LiteRT export | completed in about 4 minutes 45 seconds |
| Unquantized prefill/decode model | 9,219,066,736 bytes |
| Dynamic int8 quantized prefill/decode model | 2,827,546,672 bytes |
| Quantization ratio | 0.31, about 3.3x smaller |
| Quantized embedder | 207,933,344 bytes |
Final .litertlm package | 3,037,564,832 bytes |
Expert BATCH_MATMUL ops were intentionally left unquantized because the
current AI Edge quantizer failed Laguna's high-rank expert batch-matmul path.
The rest of the eligible prefill/decode graph was quantized with dynamic int8
weights.
Validation performed:
litert-lm-peek: package parsed as LiteRT-LM 1.5.0
ai_edge_litert interpreter: quantized prefill/decode model loaded
ai_edge_litert interpreter: quantized embedder model loaded
Hugging Face remote SHA: verified after upload
This artifact is a mobile runtime and compression research submission, not a finished assistant model.
Known weaknesses:
For Google Edge Gallery or LiteRT-LM experiments, first make sure the app is
using the v2 artifact. Because the root filename is still model.litertlm,
Edge Gallery may cache the previous package. Delete the old downloaded/imported
model in the app, then re-download or re-import from this repository. The v2
root artifact is:
size: 3,037,564,832 bytes
sha256: 16164c9cf7d32c51096dedbdcd9a08b5b57527468764e15dba115906f9bc262c
Recommended first-test prompt:
Who is the president of France?
Expected v2-style answer:
Emmanuel Macron is the president of France.
Use short generations. This model is small and brittle, so long completions increase the chance of repetition or drift.
| Setting | Recommended value |
|---|---|
| Max tokens | 32-64 for factual probes, 128 only when needed |
| Temperature | 0.2-0.3 |
| Top-k | 20-32 |
| Top-p | 0.85 |
| Repetition penalty, if available | 1.10-1.20 |
| Frequency penalty, if available | 0.2-0.4 |
If Edge Gallery exposes fewer controls, use the closest available values:
max tokens: 64
temperature: 0.25
top-k: 32
top-p: 0.85
These settings help suppress repetition and avoid weak tail tokens, but they do not make the model reliable on broad knowledge or math.
The most useful finding is that the path to a truly good phone Laguna probably is not "delete almost all experts and hope." The best next direction is likely a larger retained-expert model with more aggressive quantization, activation- aware expert selection, and a stronger recovery objective.
Promising follow-ups:
The research/ folder contains the scripts and notes used for this submission,
including:
research/scripts/recover_laguna_lm_head.py
research/scripts/eval_laguna_prompts.py
research/scripts/laguna_hf_native_merge_experts.py
research/experiments/k4_last4_recovery_litert_artifact.md
research/experiments/k4_last4_recovery_v2_litert_artifact.md
The older K16 org repository was removed after this recovered K4 artifact became the preferred hackathon submission.