Neural networks, deep learning, NLP · insight-0457
Check where the label evidence sits before truncating long texts
- Evidence type
- practitioner heuristic
- Difficulty
- medium
- Roles
- Data scientist, Applied AI
- Industries
- insurance
Summary: situation, action, reason, boundary
Situation
Insurance claim narratives or incident reports often exceed the encoder's maximum length and are cut at the limit.
Action
Plot the token-length distribution and the share of examples over the limit, check where key phrases appear, and compare head, tail and head-plus-tail truncation or chunking on validation data.
Reason
Encoders have a fixed maximum length set in pretraining, so anything beyond it is invisible unless you restructure the input.
Boundary
Classification and extraction with encoder models on long documents.
Symptom or risk
If the decisive information is near the end, such as the final assessment line, truncation removes it and the model learns from the wrong part.
Exceptions
Short texts, or tasks where the start of the document carries the label.
Trade-offs
Chunking multiplies inference cost and needs an aggregation rule.
Pitfalls
Truncating silently in the tokenizer call without logging how many examples were cut.
Lessons and concepts
Claims and their sources
Devlin et al. pretrain BERT with input sequences of at most 512 tokens.