Pointer Networks — Talks, Press, and Discussion
Press & Blog Coverage
-
Pointer Networks, NeurIPS proceedings. The NIPS 2015 version of the paper (arXiv 1506.03134).
-
Attention? Attention!, Lilian Weng. A survey of attention mechanisms with a section on Pointer Networks.
-
Get To The Point: Summarization with Pointer-Generator Networks, See, Liu and Manning (2017). Uses a pointer over the source text to copy words into summaries.
-
Neural Combinatorial Optimization with Reinforcement Learning, Bello et al. (2016). Trains pointer networks for TSP with reinforcement learning instead of supervised targets.
Q&A (answers from the paper)
Q1: What problem do Pointer Networks address? Sequence-to-sequence models “require the size of the output dictionary to be fixed a priori”, so they cannot directly handle problems where the number of possible outputs depends on the input length (Section 1).
Q2: How does a pointer differ from ordinary attention? The decoder computes u_j = vᵀ tanh(W₁ e_j + W₂ d_i) for each input position j and takes a softmax over them as the output distribution. “We do not blend the encoder state e_j to propagate extra information to the decoder, but instead, use u_j as pointers to the input elements” (Section 2.3).
Q3: How is a convex hull written as a sequence? As indices of the hull points between start and end tokens, starting “from the point with the lowest index” and going counter-clockwise, “an arbitrary choice but helps reducing ambiguities during training” (Section 3.1).
Q4: How well does it work on convex hulls? Trained and tested on 50 points, the Ptr-Net found the exact hull in 72.6% of cases, against 38.9% for an LSTM with attention and 1.9% for a plain LSTM. A model trained on 5–50 points scored 69.6% at n = 50, 50.3% at n = 100 and 1.3% at n = 500, with area coverage of 99.2% or more (Section 4.2, Table 1).
Q5: What about the other two problems? For Delaunay triangulation, accuracy was 80.7% at n = 5 and 22.6% at n = 10; at n = 50 no triangulation was exactly right, with 52.8% triangle coverage (Section 4.3). For TSP, beam search was restricted to valid tours, and a model trained on 5–20 cities produced tours close to the best algorithm (A3) up to n = 30 (4.72 against 4.60) but much longer at n = 50 (7.66 against 5.79; Section 4.4, Table 2).
Q6: What training setup did they use? A single-layer LSTM with 256 or 512 hidden units, SGD with learning rate 1.0, batch size 128, uniform initialisation in [−0.08, 0.08], gradient clipping at 2.0 and 1M training examples (Section 4.1).
Common Misconceptions
-
“Pointer Networks always produce valid solutions.” Correction: the convex hull and Delaunay decoders were unconstrained. For TSP the authors restricted beam search to valid tours because otherwise the model “would sometimes output an invalid tour”, and for n > 20 at least 10% of instances had no valid tour (Section 4.4).
-
“They generalise to any input size.” Correction: convex hull accuracy for the 5–50 model fell from 69.6% at n = 50 to 22.1% at n = 200 and 1.3% at n = 500 (Table 1).
-
“A pointer is just attention with a context vector.” Correction: the attention distribution itself is the output; it is not used to form a context vector (Section 2.3).
-
“The earlier version of this notebook showed the model learning.” Correction: its training loss was
infin every epoch and its sorting exact-match accuracy was 0.00%, because the end-of-sequence target pointed at a masked padding position. The fixed notebook reports what the corrected training reaches.