DEV Community

MindFeedLab
MindFeedLab

Posted on Originally published at Medium

Lexical Compression and Shared Context

If you write code, you already live with this problem. Every acronym in a codebase, every tmp2, every two-word commit message is a bet that the reader shares your context. Here is a way to count what that bet costs across the whole exchange.

When does a shorter message make communication faster—and when does it just move the work to the listener?

“Put the triangle above the square.”

Now imagine replacing that sentence with a single word: “dax.”

If you and I have learned the same mapping, “dax” can get the job done. If you’ve never heard it, it gives you no useful direction. The word hasn’t changed. What changed is what you knew before I said it.

That is the idea behind this theoretical framework and proposed experiment. No original participant data have been collected or analyzed. The numbers below come from a toy example, not from a study.

Count the whole exchange

By lexical compression, I mean replacing an expression with a shorter label that is meant to support the same interpretation for a particular task. The triangle instruction doesn’t require you to recover every nuance of the speaker’s meaning. You just have to identify the right arrangement. And a shorter phrase contains fewer words, but word count alone doesn’t tell you how many bits of information it conveys.

Previous research gives us several ways into this question. Clark and Wilkes-Gibbs studied how people work together to establish what they’re referring to. Frank and Goodman modeled how listeners use context and infer why a speaker chose a particular expression. Shannon’s mathematical framework lets us describe uncertainty about a defined target, while Piantadosi and colleagues examined how word length relates to predictability in context. Zaslavsky and colleagues have explored trade-offs between simplicity and accuracy in color naming and pragmatic reasoning.

The proposal here is to ask how much time an exchange actually costs: how long it takes to present and respond to the first message, how often it goes wrong, and how much time it takes to clear up misunderstandings. A fast wrong answer doesn’t make a message efficient. Training matters too. Learning a code can pay off if you use it often enough, even if learning it would be a poor investment for a one-off exchange.

The four-shape example

Imagine four equally likely targets: a triangle or circle, either above or below a square. Assign one invented word to each target at random.

With a perfectly remembered codebook and no transmission errors, each label identifies one answer. Without the mapping, the labels carry no clues under these assumptions. All four targets remain equally plausible, giving a listener a one-in-four chance of guessing correctly. An explicit description can identify the target on its own if the listener knows the ordinary vocabulary.

That 25% is a consequence of the example’s assumptions. It isn’t an estimate of how real participants will perform.

How we could test it

Randomly assign participants to learn either the codebook used in the test or a different codebook for the same amount of time. Then have both groups see a mix of compact labels and expanded descriptions. On each trial, they choose one of four arrangements. The first test would give no feedback or clarification, so participants couldn’t learn the mapping from the test itself.

The primary prediction is that expanded descriptions will have a larger advantage over compact labels in first-choice accuracy for people who haven’t learned the relevant codebook. A separate round would let participants ask for a full description. That would help test whether the seconds saved by using shorthand are lost again through clarification.

If trained participants are still slower with shorthand, the proposed speed benefit wouldn’t be supported in that setting. And if untrained participants decode randomized labels accurately, we’d need to check whether the labels or the task gave something away.

The experiment tests what the listener knows. It doesn’t test whether the speaker knows that the listener knows it. For that, we’d need an interactive follow-up. An arbitrary codebook is also simpler than real jargon, which can carry clues from a word’s roots, a conversation, or a shared history.

The next time you reach for a shortcut, try asking: How much work did I save across the whole exchange? Sometimes the most efficient thing you can do is say a few more words.

References

Clark, H. H., & Wilkes-Gibbs, D. (1986). Referring as a collaborative process. Cognition, 22(1), 1–39. https://doi.org/10.1016/0010-0277(86)90010-7.

Frank, M. C., & Goodman, N. D. (2012). Predicting pragmatic reasoning in language games. Science, 336(6084), 998. https://doi.org/10.1126/science.1218633.

Piantadosi, S. T., Tily, H., & Gibson, E. (2011). Word lengths are optimized for efficient communication. Proceedings of the National Academy of Sciences, 108(9), 3526–3529. https://doi.org/10.1073/pnas.1012551108.

Shannon, C. E. (1948). A mathematical theory of communication. The Bell System Technical Journal, 27, 379–423, 623–656. Part I; Part II.

Zaslavsky, N., Kemp, C., Regier, T., & Tishby, N. (2018). Efficient compression in color naming and its evolution. Proceedings of the National Academy of Sciences, 115(31), 7937–7942. https://doi.org/10.1073/pnas.1800521115.

Zaslavsky, N., Hu, J., & Levy, R. P. (2021). A Rate–Distortion view of human pragmatic reasoning? In Proceedings of the Society for Computation in Linguistics 2021 (pp. 347–348). Association for Computational Linguistics. Publisher record and paper.


Originally published on Medium. MindFeedLab makes short films about science, philosophy and the mind: youtube.com/@mindfeedlab.

Top comments (0)