Grammatical encoding has the task of selecting and retrieving the syntactic and lexical forms that can convey non-linguistic thoughts, and then determining the morphological forms and their constituent ordering in preparation for their phonological spell-out and eventual externalization. This chapter begins by broadly describing a consensus view of the general architecture of grammatical encoding. It then describes ongoing debates that operate within (or question aspects of) this consensus view, including about the content and structure and selection-then-retrieval character of grammatical encoding; the incrementality or scope of grammatical encoding; the factors that influence syntactic choice; the rational or optimal nature of production; effects of ongoing learning; and production in dialogue. It closes on a constructive note, highlighting fundamental insights that we have gained as a field along the way.