Skip to content

Latest commit

 

History

History
170 lines (119 loc) · 5.75 KB

File metadata and controls

170 lines (119 loc) · 5.75 KB

Promotion posts

Use these snippets for careful, citation-oriented outreach. The goal is to attract readers who may reuse, benchmark, or cite the method.

One-line summary

me_fasttext is a FastText-derived C++ prototype that replaces hash-bucketed subword ids with exact trie-backed ids, then exports a compact mmap serving index for large-vocabulary NLP.

Short post

I released me_fasttext, a memory-efficient FastText-derived C++ prototype for
large-vocabulary NLP.

The core idea: train with exact trie-backed word/subword ids instead of opaque
hash buckets, then export a compact mmap serving index via conservative n-gram
row sharing and mark-compact layout.

Useful when you still want FastText-style OOV behavior for retrieval, ranking,
or long-tail text features, but need a smaller serving footprint.

Code: https://github.com/initial-d/me_fasttext
Paper: https://arxiv.org/abs/2506.01254

Technical post

FastText's hash buckets are convenient, but they make character n-gram identity
opaque: unrelated subwords can collide into the same row.

me_fasttext explores an exact-first, compact-later design:

1. assign words and UTF-8 character n-grams exact trie-backed ids
2. train FastText-style word/subword embeddings
3. merge only structurally related n-gram rows with very close vectors
4. rewrite live rows into a compact mmap-ready serving artifact

The paper reports a large Chinese vocabulary benchmark with 30.1M words and
287.4M n-grams, reducing model memory from 145.2 GB to 28.9 GB while preserving
downstream quality within 0.3 points of the hash-free model.

Code: https://github.com/initial-d/me_fasttext
Paper: https://arxiv.org/abs/2506.01254
Engineering note: https://github.com/initial-d/me_fasttext/blob/main/docs/engineering_note.md

Systems-angle post

I finally wrote down the design idea behind me_fasttext:

FastText-style subword models are not only NLP models. At large vocabulary
scale, they become memory-layout problems.

me_fasttext treats character n-gram embeddings as structured memory objects:
train first with exact trie-backed subword identities, then rewrite retained
rows into a compact mmap serving artifact using a mark-compact-style export
step.

The interesting part is the bridge between three older ideas:

1. classical dynamic memory management
2. trie-backed lexical identity
3. FastText's character n-gram statistics

Design essay:
https://github.com/initial-d/me_fasttext/blob/main/docs/memory_management_for_ai_embeddings.md

Code:
https://github.com/initial-d/me_fasttext

Chinese long-form post

我整理了一篇 `me_fasttext` 的中文技术回顾:

《我把动态内存管理用在了 FastText 的 n-gram embedding 上》

这个项目表面上是一个 memory-efficient FastText 变体,但真正的设计点是:
把 FastText 的大规模 n-gram embedding 矩阵看成一个结构化内存对象。

先用 trie 保留精确 subword identity,再在训练后用类似 mark-compact 的方式
把向量行整理成紧凑、可 mmap serving 的模型 artifact。

我觉得它最有意思的地方,是把动态内存管理、字典树、FastText 的 n-gram
语言统计现象接在了一起。

文章:
https://github.com/initial-d/me_fasttext/blob/main/docs/technical_retrospective_zh.md

代码:
https://github.com/initial-d/me_fasttext

Hacker News / Lobsters title options

  • Memory-Efficient FastText with Exact Trie N-Gram IDs and mmap Serving
  • Replacing FastText Hash Buckets with Trie-Backed Subword IDs
  • Mark-Compact Layouts for FastText-Style Embedding Serving
  • Memory Management for FastText-Style Subword Embeddings

Reddit title options

  • I built a memory-efficient FastText variant with trie-backed subword IDs
  • Exact subword IDs + mmap serving for FastText-style embeddings
  • Revisiting FastText for OOV-heavy retrieval and low-memory serving
  • Applying mark-compact memory management ideas to subword embeddings

Maintainer note

Hi, thanks for maintaining this list.

Would you consider adding `me_fasttext`?

It is a FastText-derived C++ research prototype for memory-sensitive
large-vocabulary NLP. Instead of hashing character n-grams into fixed buckets,
it assigns exact trie-backed ids, then exports a compact mmap serving index via
conservative row sharing and mark-compact layout.

Repo: https://github.com/initial-d/me_fasttext
Paper: https://arxiv.org/abs/2506.01254

Disclosure: I maintain the project. I think it fits best under word embeddings,
retrieval infrastructure, or model compression depending on your taxonomy.
Happy to adjust or withdraw if it is out of scope.

Researcher note

Hi,

I thought this might be relevant to your work on embeddings / retrieval /
efficient NLP systems.

I released me_fasttext, a FastText-derived C++ prototype that replaces
hash-bucketed character n-gram ids with exact trie-backed ids, then exports a
compact mmap serving index. The goal is to keep FastText-style OOV behavior
while reducing large-vocabulary serving cost.

Paper: https://arxiv.org/abs/2506.01254
Code: https://github.com/initial-d/me_fasttext

If you try it on another corpus, I would be especially interested in benchmark
reports that include memory, load time, query latency, and downstream quality.

Citation call-to-action

Use this only where appropriate:

If the exact-id-before-compression design, benchmark protocol, or mmap serving
layout is useful in your own work, please cite the arXiv paper:
https://arxiv.org/abs/2506.01254

What not to say

  • Do not claim it replaces transformer embeddings.
  • Do not call it a complete RAG framework.
  • Do not describe it as a garbage collector implementation.
  • Do not imply the reported compression ratio is universal.
  • Do not post the same text across many communities on the same day.