TFM is an extended Markdown format for representing Telegram messages, inspired by GitHub's and Notion's Markdown formats.
This repository contains TFM.md — format description (≈1000 tokens) to teach your LLM speak in TFM.
Q: Telegram already has MarkdownV2, why not just use it?
We believe MarkdownV2 parse mode supported by Telegram Bot API is poorly suited for LLMs for several reasons:
-
Too Strict: MarkdownV2 requires escaping almost every special character (
_,*,[,], etc.) if it isn't part of a formatting entity. LLMs frequently fail to escape characters consistently, causing the Telegram API to reject messages with400 Bad Requesterrors. -
Non-Standard: MarkdownV2 differs from the common Markdown format that LLMs are overwhelmingly trained on:
- Markdown:
**bold**,*italic*,~~strikethrough~~ - MarkdownV2:
*bold*,_italic_,~strikethrough~
This mismatch requires heavy system prompting and in LLMs not following the format correctly.
- Markdown:
-
Bizarre Syntax: Advanced features like expandable block quotations use non-intuitive syntax (e.g.,
**>The expandable block...||) that combines empty bold entities and spoiler tags. LLMs struggle to replicate such syntax hacks consistently.