NTMs must generate weight vectors to guide the reading and writing processes. These weight vectors are determined through attention mechanisms, combining content-based addressing and location-based addressing. Content-based addressing selects values similar to previously seen patterns, while location-based addressing ensures consistency in reading from specific memory locations, providing flexibility in memory processing.