Great question — you're digging into an often-overlooked but crucial detail in LLM-human interaction design.
🧠 First, how is formatting (like markdown) included in tokens?
Large Language Models (LLMs) like me are trained on text — including formatting tokens. That is, the input and output are typically encoded as plain text with formatting syntax like:
bold → for bold
or ## → for headings
- or * → for unordered list
- → for ordered list
--- → for horizontal rules
During training, these characters are tokenized just like any other text. For instance:
md複製程式碼## Section Title
This is a bold word.
...is tokenized as individual tokens including ##, Section, Title, This, is, a, **, bold, etc., depending on the tokenizer used (like Byte-Pair Encoding for GPT).
These formatting characters are not metadata — they are simply part of the string input/output. So yes, they're part of the tokens.
📦 Now, to your main question:
If I want to collect data from conversations between human and LLM bot, do you think these text-format information are important and should be collected?
Short answer: YES. Absolutely.
Here’s why:
✅ Why formatting matters in collected conversational data
- Semantic Signaling
Formatting gives semantic structure to the conversation:
Headings = hierarchy
Lists = enumeration or grouping
Bold = emphasis or key points
This structure helps humans read and interpret responses more easily. A model learning from this data will better understand how to communicate clearly, not just what to say.
- Behavioral Insights
By analyzing how formatting is used, you can study:
What kinds of prompts lead to structured responses?
When do LLMs choose to use headings vs. bullet points?
Does formatting correlate with user satisfaction or retention?
These insights are invaluable for improving response quality and user experience.
- Training & Fine-Tuning
If you’re training or fine-tuning a model, keeping the formatting:
Helps the model learn to produce structured outputs
Enables the model to understand contextual emphasis
Prevents training on flattened, low-information text
You want your model to see, for example, that:
md複製程式碼### Pros
Cons
...is much more useful than:
sql複製程式碼Pros are easy to use and lightweight. Cons are that it lacks advanced features.
- Reusability
Formatted output is easier to:
Render directly on web interfaces
Convert to other formats (PDF, HTML, docs)
Post-process with parsers (like markdown parsers)
This makes your collected data much more versatile.
❌ When might formatting not matter?
If you only want to analyze semantic content or intent classification, then formatting might be noise.
In token-count–sensitive settings, like training cost estimation or low-resource models, you might preprocess away formatting.
Still, even in these cases, you might want to keep it as metadata for optional use.
🔍 Recommendation:
When collecting data:
✅ Keep the formatting (markdown or otherwise)
✅ Log both raw and rendered forms if possible
✅ Consider preserving "formatting intent" as a separate feature (e.g., {"type": "list", "items": [...]}) if doing structured data extraction
Would you like a sample schema for logging LLM conversations with formatting included?