File size: 2,082 Bytes
de707c4
bc9432c
 
 
 
de707c4
76ebb22
de707c4
 
bc9432c
46bf5e2
bc9432c
 
 
 
 
 
 
 
 
 
 
 
 
 
994d29d
00ee645
bc9432c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76ebb22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: Datasent
emoji: 🟪
colorFrom: indigo
colorTo: blue
sdk: static
pinned: true
---

<div align="center">
  <img src="https://huggingface.co/spaces/datas3nt/README/resolve/main/datasent_banner.png" alt="Datasent - Polygen: polynomial tokenization and compression for ML data" width="920" style="width:100%; max-width:920px;" />
</div>

Datasent builds **Polygen**, an SDK that tokenizes numeric, image, text, audio,
and video data by fitting a compact basis to each window, with a lossless
`x = f_x + r` decomposition: the fitted prediction `f_x` plus the residual `r`.
The representation is small, structured, and decodes exactly.

## Polygen for Qwen2-VL

Our flagship demo applies Polygen to a vision-language model: it compresses the
visual tokens Qwen2-VL feeds to the LLM, and a small LoRA adapter teaches the
model to read the compressed representation. On ScienceQA the recipe holds or
improves accuracy while shrinking the visual sequence:

- **+8.4pp accuracy** over the un-spliced baseline at the accuracy tier (T=3)
- At the compression tier (T=2, +7.4pp accuracy): **~49% fewer visual tokens** and **~3.7x (nearly 4x) more requests per GPU** in cached serving
- **~5x smaller** stored visual representation

The vision encoder and LLM weights are otherwise untouched; the compression sits
between the merger and the LLM.

## Try it

- **[Polygen for Qwen2-VL](https://huggingface.co/spaces/datas3nt/qwen2vl-polygen)** -- upload an image, compare answers with and without compression, scored per image
- **[Polygen RAG demo](https://huggingface.co/spaces/datas3nt/qwen2vl-polygen-rag)** -- retrieval over a compressed visual-token corpus
- **[Polygen tokenization demo](https://huggingface.co/spaces/datas3nt/polygen-demo)** -- the core tokenizer

## Models

- **[qwen2vl-polygen-7b-lora-r16-1000](https://huggingface.co/datas3nt/qwen2vl-polygen-7b-lora-r16-1000)** -- 7B LoRA adapter
- **[qwen2vl-polygen-lora-r16-1000](https://huggingface.co/datas3nt/qwen2vl-polygen-lora-r16-1000)** -- 2B LoRA adapter

Learn more at [datasent.com](https://www.datasent.com).