Cognitive code learning refers to a theory of second language teaching developed in the 1960s based on two models: cognitivist psychology focusing on mental processes involved in knowledge acquisition, and generative grammar which looks at structural applied linguistics. It was advocated by B. Carroll and Kenneth Chastain as an alternative to audiolingual methods. The teacher's role is to build on existing knowledge, help students relate new concepts to their own experiences, avoid rote learning, and clarify relationships, while the student takes greater responsibility for their own learning by learning from errors and connecting new knowledge to prior understanding.