A data-compaction code in which the encoding (and therefore decoding) table is formed from the statistics of the particular file (or data stream) being compacted. This may happen either incrementally, or, if feasible, during a preliminary pass over the input data. The decoding table must be stored or transmitted along with (i.e. following or interspersed within) the compacted text, so that the message can be decompacted when required (compare probabilistic compaction).
In the incremental case, if the gathering of statistics (and formation of the table) is recommenced (wholly or partly) whenever the performance falls below some limit, then the code is said to be adaptive.