I masked a dataset for an LLM and kept every checksum valid — here's the approach
Sharing data with an LLM is a data-leak problem with an extra twist: the model is a reader, not a database. If you scrub a spreadsheet with *** , the model has nothing to reason about. If you replace every cell with random noise, joins break and the analysis collapses. This post walks through the middle path: generate fake values that keep the original shape, so the file still imports, validates,…
Sharing data with large language models (LLMs) presents a data-leak problem. To address this issue without losing the original shape of the data, a middle path can be taken by generating fake values that maintain the original structure. The source describes a method for creating fake values that pass validation checks, such as phone numbers, Chinese ID numbers, bank card numbers, and email addresses.
The fake values are created using a deterministic method based on HMAC-SHA256, where the same input and secret produce the same output, but a different secret results in a different output. This allows for the preservation of the original structure while ensuring that the fake values pass validation checks, making them suitable for use with LLMs.
The process includes creating a masking file using a secret file and sending the masked file to the model. The original values can be restored only if necessary, keeping the secret secure. The method has been tested with various data types, and the results show that the masked data retains its validity and integrity.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.