A data scientist trained a sequence-to-sequence model for English→Japanese translation using 500,000 sentence pairs. Short sentences (about five words) translate well, but translations for very long sentences (around 100 words) are poor. What change will most likely fix the problem?
Choose an answer
Tap an option to check your answer.
Correct answer: Tune hyperparameters related to the attention mechanism..
Why this is the answer
The problem describes a sequence-to-sequence model struggling with long sentences, a classic symptom of the vanishing/exploding gradient problem or an inability to capture long-range dependencies. While RNNs inherently struggle with long sequences, the attention mechanism was specifically designed to address this by allowing the model to focus on relevant parts of the input sequence regardless of their position. Tuning hyperparameters related to attention (e.g., number of attention heads, attention type) will most directly improve the model's ability to handle long-range dependencies and thus long sentences. Preprocessing into n-grams might lose contextual information. Increasing RNN units alone won't solve the long-range dependency issue if attention isn't optimized. A different weight initialization scheme is unlikely to be the primary solution for this specific problem.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed