CrumpLab / EntropyTyping

A repository for collaborating on our new manuscript investigating how keystroke dynamics conform to information theoretic measures of entropy in the letters people type.
https://crumplab.github.io/EntropyTyping
6 stars 2 forks source link

Working on the big idea #5

Open CrumpLab opened 6 years ago

CrumpLab commented 6 years ago

Here is a graph from Ostry (1983) who surveyed variation in keystroke times in continuous copy typing as a function of word length and letter position

Ostry, D. J. (1983). Determinants of interkey times in typing. In Cognitive aspects of skilled typewriting (pp. 225-246). Springer, New York, NY.

screen shot 2018-06-12 at 11 39 47 am

This one shows mean IKSIs for all positions in words of length 5-8, inclusive of the the space at the end. There are two prominent effects discussed by Ostry. These data are taken from continuous typing where people copy type sentences in a paragraph

  1. First letter slowing: The first keystroke is slower than the others.

  2. Mid-word slowing: There is an inverted U-curve for IKSIs after position 1. IKSIs in the middle are slower than IKSIs near the beginning and the end.

What explains these two phenomena?

Do these two phenomena reflect the same or different underlying production processes?

  1. Planning accounts. My reading of Ostry is that a planning/buffering process could explain the variation in IKSI. For example, first letter slowing could reflect the time necessary to plan the whole word. A similar kind of planning process might operate at the syllable level within words, and it might take additional time to plan syllables at syllable boundaries. Perhaps, this could explain mid-word slowing

  2. Letter uncertainty account. In this project we are pursuing the idea that variation in IKSI might be determined by variation in letter uncertainty. From the Hick-Hyman law, we know that choice reaction time speed can be influenced by entropy (or H, or predictability) among the options. Typing is a 26-AFC (alternative forced-choice) serial reaction time task, and typing time might be similarly influenced by predictability of letters (choices) in the sequences.

CrumpLab commented 6 years ago

Clarifying Core Ideas

It's worth developing some pithy sentences that more sublimely clarify our core questions. Some attempts:

  1. Are keystroke dynamics determined by the information structure of natural language?
  2. Are keystroke dynamics determined by letter predictability?

Prior work (e.g., Ostry, 1983) has demonstrated systematic influences of letter position and word length on keystroke typing times. First letters are typed more slowly than other letters, and letters in the middle of words are typed more slowly than letters at the beginning and ending of words (see above figure).

What process(es) cause first-letter and mid-word slowing? Can we learn something about those processes by examining first-letter and mid-word slowing? We think so.

Our project is in part based off of a hunch, a reasonably well informed one brought to us by information theory and the hick-hyman law: choice-reaction time performance can sometimes be well explained by the amount of information in the set of choices. When the relationship holds, reaction time generally increases as a function of information (measured by Shannon's H). In other words, people are faster for more than less predictable choices.

Typing is like a continuous choice-reaction time task (26 choices for lower case letters). So, our hunch is that keystroke dynamics (reaction times for each keystroke choice) might be "explained" by "information" in the letter sequences that people type. For now, by "explained", we mean share variance, not that a measure of entropy would provide a process explanation of the typing production. And, "information" means the number of bits needed to code the set of choices, which provides a measure of uncertainty, or predictability.

Now, we can ask our core question in the form of a hypothetical graph:

screen shot 2018-06-12 at 11 39 47 am

If we could measure letter uncertainty for every position in words of ever length, then we could create a graph like the one above. The question is whether graph will look like the one above (which is just copied from Ostry's graph of keystroke times).

We are creating the possibility for one of George Miller's magic moments. If we found that letter uncertainty (in English) as measured by information theory, natural varies in the same way that keystroke typing times vary across position and word length, then we might have a magic moment. For example, we might plausibly entertain the idea that some process sensitive to letter uncertainty is driving the pattern of keystroke dynamics that we observer in continuous typing.

How could letter uncertainty for every position in words of different lengths be measured?

We live in the age of downloading convenient data-sets from google, so fortunately, we have a way to do this.

Google has been digitizing many millions of books. This creates an electronic record of every letter written in every book that was digitized. Peter Norvig (now Director of Research at Google) blogged some interesting tidbits from Google's book project (see also their n-gram database). Norvig counted letter frequency distributions for all letters occuring in positions 1 through 9 in words of length 1 to 9, in all the words in the google dataset. This amounts to 45 letter frequency distributions.

We can convert the letter frequency distributions to probability distributions by dividing each count by their totals. Then we can apply the Shannon's entropy formula to each distribution to calculate H, which will measure the amount of entropy in each distribution. Distributions of letters that are fully random (each letter is equally probably) will have the maximum H of about 4.7 (assuming 26 lower case options). Distributions that have some predictability (some letters occur more frequently than others) will have Hs that tend toward zero as predictability goes to maximum (when only one letter ever occurs). So, we can turn our hypothetical plot into a real plot. Then we can look at the plot of letter uncertainty by position and word length, and compare it to the plot of mean keystroke time by position and word length. If they are the same, we might get our magic moment.

-notes: it took me too long to get across the core idea here, but some of this might be useful for the paper.

CrumpLab commented 6 years ago

TLDR of our question

If Figure A (keystroke times by position and word length) looks like Figure B (Hypothetical way in which letter uncertainty could vary by position and word length), then we might consider an account of first-letter and mid-word slowing in terms of information theory, or process sensitive to letter uncertainty.

tldr