Studies have shown that attention significantly affects memory during the encoding phase, but hardly at all during recall.
Thus, distractions or divided attention during initial learning may severely impair subsequent retrieval success, whereas distractions at the time of recall may slow down the process a little, but has little to no effect on its accuracy.

Sensory memory is the shortest-term element of memory. It is the ability to retain impressions of sensory information after the original stimuli have ended. It acts as a kind of buffer for stimuli received through the five senses of sight, hearing, smell, taste and touch, which are retained accurately, but very briefly. For example, the ability to look at something and remember what it looked like with just a second of observation is an example of sensory memory.

The stimuli detected by our senses can be either deliberately ignored, in which case they disappear almost instantaneously, or perceived, in which case they enter our sensory memory. This does not require any conscious attention and, indeed, is usually considered to be totally outside of conscious control. The brain is designed to only process information that will be useful at a later date, and to allow the rest to pass by unnoted. As information is perceived, it is therefore stored in sensory memory automatically and unbidden. Unlike other types of memory, the sensory memory cannot be prolonged via rehearsal.

Sensory memory is an ultra-short-term memory and decays or degrades very quickly, typically in the region of 200 - 500 milliseconds (1/5 - 1/2 second) after the perception of an item, and certainly less than a second (although echoic memory is now thought to last a little longer, up to perhaps three or four seconds). Indeed, it lasts for such a short time that it is often considered part of the process of perception, but it nevertheless represents an essential step for storing information in short-term memory.

The sensory memory for visual stimuli is sometimes known as the iconic memory, the memory for aural stimuli is known as the echoic memory, and that for touch as the haptic memory. Smell may actally be even more closely linked to memory than the other senses, possibly because the olfactory bulb and olfactory cortex (where smell sensations are processed) are physically very close - separated by just 2 or 3 synapses - to the hippocampus and amygdala (which are involved in memory processes). Thus, smells may be more quickly and more strongly associated with memories and their associated emotions than the other senses, and memories of a smell may persist for longer, even without constant re-consolidation.

Experiments by George Sperling in the early 1960s involving the flashing of a grid of letters for a very short period of time (50 milliseconds) suggest that the upper limit of sensory memory (as distinct from short-term memory) is approximately 12 items, although participants often reported that they seemed to "see" more than they could actually report.

Information is passed from the sensory memory into short-term memory via the process of attention (the cognitive process of selectively concentrating on one aspect of the environment while ignoring other things), which effectively filters the stimuli to only those which are of interest at any given time.