# Are LSTMs Good Few-Shot Learners?

LSTM은 좋은 퓨샷 학습자인가?

Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · arXiv · 2023년 10월 22일

- **연구 문제** 평범한 LSTM을 현대 few-shot 벤치마크의 메타학습기로 쓸 때 사인파 회귀에서는 MAML을 앞서지만 이미지 분류에서는 부진한 이유를 분석하고, 두 구조적 문제를 해결하는 OP-LSTM을 제안합니다.
- **연구 방법** 지원 데이터에 평균 풀링을 적용해 입력 순서 불변성을 확보하고, 기반 학습기의 2D 은닉 상태를 LSTM이 외적 규칙으로 갱신하도록 하여 입력 표현과 학습 절차를 분리합니다.
- **주요 결과** 사인파 회귀의 5-shot에서는 LSTM이 MAML보다 낮은 MSE를 보였고, Omniglot과 miniImageNet에서 OP-LSTM은 MAML 및 프로토타입 기준선과 경쟁적인 정확도를 보였습니다. 평범한 LSTM은 이미지 분류에서 우연 수준에 머물렀습니다.

## 연구 질문과 배경

이 논문은 Hochreiter 등이 제안한 방식, 즉 지원 데이터를 LSTM에 순서대로 입력하고 가중치는 과제 사이에서만 갱신하는 평범한 LSTM 메타학습을 현대 지도 few-shot 벤치마크에서 다시 검증합니다. 이 접근은 작은 문제와 강화학습에서는 성과가 보고되었지만 지도 few-shot 학습에서는 거의 연구되지 않았습니다. 저자들은 사인파 회귀에서는 LSTM이 MAML보다 낮은 MSE를 보였지만, 이미지 분류에서는 평범한 LSTM이 부진하다고 보고합니다. 저자들은 그 원인으로 입력 순서에 대한 불변성이 없다는 점과 입력 표현과 학습 절차가 한 은닉 상태에 얽혀 있다는 점을 제시합니다.

## LSTM 메타학습의 두 가지 문제와 완화 방법

첫 번째 문제는 지원 데이터가 집합인데도 LSTM은 순서가 있는 시퀀스로 처리한다는 점입니다. 저자들은 M개의 지원 예제 각각에 대해 LSTM 상태를 갱신한 뒤 평균하는 평균 풀링을 제안하며, 이렇게 하면 입력 순서에 불변인 상태를 얻습니다. 두 번째 문제는 LSTM의 은닉 상태가 학습 알고리즘과 입력 임베딩을 동시에 담당한다는 점입니다. 저자들은 기반 학습기 네트워크의 출력 a(L-1)(x)와 은닉 상태 h(L)의 내적으로 예측을 만들어 두 역할을 분리하는 구조를 제안합니다. 이 분리는 기반 학습기 가중치를 메타 네트워크가 갱신하는 방향으로 이어집니다.

![Figure 5: The average accuracy score of a plain LSTM with sequential and batch support data processing on few-shot sine wave regression (left) and Omniglot cla…](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170/figures/figure-d5e9b236afaa31f11657c777687e1740.png?thumb=512)

**Figure 5** : The average accuracy score of a plain LSTM with sequential and batch support data processing on few-shot sine wave regression (left) and Omniglot classfication (right) for different numbers of training examples per task. Note that a lower MSE (left) or a higher accuracy (right) corresponds to better performance. The results are averaged over 3 runs (each measured over 600 meta-test tasks) with different random seeds and the 95% confidence intervals over the mean performances of the runs are shown as shaded regions. Additionally, in the right plot, we have added scatter marks to indicate the average performances per run (dots, unconnected, 3 per setting). Batch processing performs on par or outperforms sequential processing and improves the training stability over different runs.

[원문](https://arxiv.org/abs/2310.14139v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · Are LSTMs Good Few-Shot Learners? · 원문 그림 인용 · 원본 PDF 15쪽에서 그림 영역을 추출했습니다.

## OP-LSTM의 외적 기반 갱신

OP-LSTM은 LSTM이 기반 학습기의 가중치 역할을 하는 2D 은닉 상태 H를 직접 갱신하도록 설계된 방법입니다. 층 l의 2D 은닉 상태는 지원 예제별 외적 항을 Frobenius 노름으로 정규화한 뒤 평균하여 갱신됩니다. 식으로는 \\(H^{(\\ell)}\_{t+1}=H^{(\\ell)}\_t+\\gamma\\frac{1}{M}\\sum\_{i=1}^{M}\\frac{h^{(\\ell)}\_{t+1}(x'\_i)a^{(\\ell-1)}\_t(x\_i)^{T}}{\\lVert h^{(\\ell)}\_{t+1}(x'\_i)a^{(\\ell-1)}\_t(x\_i)^{T}\\rVert\_F}\\) 입니다. 여기서 γ는 갱신 크기이며, 평균을 취하므로 갱신 결과는 지원 데이터의 순서에 불변입니다.

개별 은닉 벡터 h는 좌표별 LSTM이 계산하며, 마지막 층은 예측과 정답을, 앞 층은 역방향으로 전달된 오차 신호를 입력으로 받습니다. 저자들은 이 구조가 MAML의 그래디언트 갱신과 프로토타입 분류기를 근사할 수 있다고 분석합니다.

![Figure 6: The average cosine similarity (left) and Euclidean distance (right) between the weight up- date directions of the OP-LSTM and a prototype-based and g…](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170/figures/figure-8afe62281dd791bbec3b5ab9f5f83721.png?thumb=512)

**Figure 6** : The average cosine similarity (left) and Euclidean distance (right) between the weight up- date directions of the OP-LSTM and a prototype-based and gradient-based classifier as a function of time on 5-way 1-shot miniImageNet classification. Each point on the x-axis indicates a valida- tion step, which is performed after every 2 500 episodes. The results are averaged over 3 runs with different random seeds and the 95% confidence intervals are shown as shaded regions. The confid- nce intervals are within the size of the symbols and imperceptible. As time progresses, the updates performed by OP-LSTM become more similar to those of gradient descent and prototype-based classifiers (increasing cosine similarity).

[원문](https://arxiv.org/abs/2310.14139v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · Are LSTMs Good Few-Shot Learners? · 원문 그림 인용 · 원본 PDF 19쪽에서 그림 영역을 추출했습니다.

## 사인파 회귀 비교

사인파 회귀에서 5-shot 평균 테스트 MSE는 LSTM 0.04 ± 0.002, OP-LSTM 0.11 ± 0.009, MAML 0.18 ± 0.009로 보고되며, 낮을수록 좋습니다. 이 설정에서는 LSTM이 5-shot에서 가장 좋은 값을 보였습니다. 10-shot과 20-shot에서는 OP-LSTM이 LSTM보다 낮은 MSE를 보여 각각 0.008 ± 0.001과 0.003 ± 0.000을 기록했습니다. 두 방법 모두 파라미터 수가 MAML과 비슷한 수준이라고 표에 명시되어 있어 MAML보다 우수한 결과가 단순한 파라미터 증가로만 설명되지는 않는다고 저자들은 해석합니다. 이 결과는 사인파 회귀라는 단순한 과제에서 얻은 것입니다.

![Table 1: Average test MSE on few-shot sine wave regression. The 95% confidence intervals are displayed as ±x, and calculated over all meta-test tasks. We used…](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170/figures/figure-ddd2c80281c1b46db090d554c52e486d.png?thumb=512)

**Table 1** : Average test MSE on few-shot sine wave regression. The 95% confidence intervals are displayed as ±x, and calculated over all meta-test tasks. We used batch processing for the LSTM and OP-LSTM. The best performances are dislpayed in bold font.

[원문](https://arxiv.org/abs/2310.14139v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · Are LSTMs Good Few-Shot Learners? · 원문 그림 인용 · 원본 PDF 16쪽에서 그림 영역을 추출했습니다.

## Omniglot과 miniImageNet 분류 비교

Omniglot 5-way 분류에서 1-shot 정확도는 MAML 84.1 ± 0.90, ProtoNet 83.6 ± 0.88, LSTM 72.6 ± 0.90, OP-LSTM 84.3 ± 0.90입니다. 5-shot에서는 MAML 93.5, OP-LSTM 91.8, LSTM 84.8로 OP-LSTM이 MAML보다 낮습니다. miniImageNet 5-way 분류에서 평범한 LSTM의 1-shot 정확도는 20.2 ± 0.20으로 우연 수준에 머물렀습니다. 같은 설정에서 OP-LSTM은 51.9 ± 1.04였으나 SAP는 53.0 ± 1.08로 더 높았습니다. 저자들은 OP-LSTM이 다른 기준선과 경쟁적이라고 해석하며, 최고 성능을 주장하지는 않습니다.

![Table 2: The mean test accuracy (%) on 5-way Omniglot classification across 3 different runs. The 95% confidence intervals are displayed as ±x, and calculated…](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170/figures/figure-4fc94f597bf5be770e5d4ecf96f9997a.png?thumb=512)

**Table 2** : The mean test accuracy (%) on 5-way Omniglot classification across 3 different runs. The 95% confidence intervals are displayed as ±x, and calculated over all runs and meta-test tasks (600 per run). The plain LSTM is outperformed by MAML. All methods (except LSTM) used a fully-connected feed-forward classifier. The best performances are dislpayed in bold font.

[원문](https://arxiv.org/abs/2310.14139v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · Are LSTMs Good Few-Shot Learners? · 원문 그림 인용 · 원본 PDF 16쪽에서 그림 영역을 추출했습니다.

![Table 3: Meta-test accuracy scores on 5-way miniImageNet and CUB classification over 3 runs. The 95% confidence intervals are displayed as± x, and calculated o…](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170/figures/figure-44840cd163e76eb8df011275ef60d9cf.png?thumb=512)

**Table 3** : Meta-test accuracy scores on 5-way miniImageNet and CUB classification over 3 runs. The 95% confidence intervals are displayed as± x, and calculated over all runs and meta-test tasks (600 per run). All methods used a Conv-4 backbone as a feature extractor. The “-” indicates that the method did not finish within 2 days of running time. The best performances are dislpayed in bold font.

[원문](https://arxiv.org/abs/2310.14139v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · Are LSTMs Good Few-Shot Learners? · 원문 그림 인용 · 원본 PDF 17쪽에서 그림 영역을 추출했습니다.

## 교차 도메인 분류 결과

교차 도메인 실험은 miniImageNet에서 학습해 CUB에서 평가하는 MIN → CUB와 그 반대 방향인 CUB → MIN으로 구성됩니다. MIN → CUB 1-shot에서 OP-LSTM은 42.3 ± 0.42를 기록해 MAML 37.9 ± 0.40, ProtoNet 39.7 ± 0.41보다 높고, Warp-MAML 42.0 ± 0.43과 비슷한 수준입니다. CUB → MIN 1-shot에서 OP-LSTM은 35.8 ± 0.40으로 SAP 33.3 ± 0.39와 MAML 31.1 ± 0.36보다 높습니다. 평범한 LSTM은 두 방향 모두 우연 수준이었습니다. 이 결과는 Conv-4 백본을 사용한 이 두 시나리오에서만 확인되었습니다.

![Table 4: Average cross-domain meta-test accuracy scores over 5 runs using a Conv-4 backbone. Techniques trained on tasks from one data set and were evaluated o…](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170/figures/figure-663078a33548dd5d3efa8c8764850e3c.png?thumb=512)

**Table 4** : Average cross-domain meta-test accuracy scores over 5 runs using a Conv-4 backbone. Techniques trained on tasks from one data set and were evaluated on tasks from another data set. The 95% confidence intervals are displayed as ± x, and calculated over all runs and meta-test tasks. The “-” indicates that the method did not finish within 2 days of running time. The best performances are dislpayed in bold font.

[원문](https://arxiv.org/abs/2310.14139v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · Are LSTMs Good Few-Shot Learners? · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.

## 결과의 적용 범위와 한계

저자들은 각 방법을 3회 실행했으며 일부 비교는 시드별 분산과 실행 시간 제한 때문에 완전히 같은 조건에서 수행되지 않았다고 밝힙니다. 평범한 LSTM의 miniImageNet CUB 실험 일부는 2일 안에 완료되지 않았습니다. OP-LSTM은 최대 풀링 층을 통한 역방향 메시지 전달을 지원하지 않아 Conv-4 백본에서는 마지막 층에만 적용되었습니다. 또한 Warp-MAML과 SAP와의 결합은 이 연구에서 다루지 않았습니다. MAML 기준선은 원 논문의 보고 하이퍼파라미터를 사용했으며, LSTM과 OP-LSTM은 별도 탐색을 거쳤으므로 완전히 동일한 튜닝 조건은 아닙니다.

![Table 7: Mean running times on 5-way miniImageNet and CUB classification over 3 runs. All methods used a Conv-4 backbone as a feature extractor. “ xhymin” mean…](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170/figures/figure-84c1fb059f1133d323318e362c9f7e3d.png?thumb=512)

**Table 7** : Mean running times on 5-way miniImageNet and CUB classification over 3 runs. All methods used a Conv-4 backbone as a feature extractor. “ xhymin” means x hours and y minutes. The “-” indicates that the method did not finish within 2 days of running time.

[원문](https://arxiv.org/abs/2310.14139v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn · Are LSTMs Good Few-Shot Learners? · 원문 그림 인용 · 원본 PDF 28쪽에서 그림 영역을 추출했습니다.

## 논문 정보

- **저자**: Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2023년 10월 22일
- **등록일**: 2026년 11월 6일
- **수정일**: 2023년 10월 22일
- **버전**: v1
- **arXiv**: 2310.14139
- **분류**: cs.LG · cs.AI · stat.ML
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2310.14139v1) · [원문 PDF ↗](https://arxiv.org/pdf/2310.14139v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Deep learning requires large amounts of data to learn new tasks well, limiting its applicability to domains where such data is available. Meta-learning overcomes this limitation by learning how to learn. In 2001, Hochreiter et al. showed that an LSTM trained with backpropagation across different tasks is capable of meta-learning. Despite promising results of this approach on small problems, and more recently, also on reinforcement learning problems, the approach has received little attention in the supervised few-shot learning setting. We revisit this approach and test it on modern few-shot learning benchmarks. We find that LSTM, surprisingly, outperform the popular meta-learning technique MAML on a simple few-shot sine wave regression benchmark, but that LSTM, expectedly, fall short on more complex few-shot image classification benchmarks. We identify two potential causes and propose a new method called Outer Product LSTM (OP-LSTM) that resolves these issues and displays substantial performance gains over the plain LSTM. Compared to popular meta-learning baselines, OP-LSTM yields competitive performance on within-domain few-shot image classification, and performs better in cross-domain settings by 0.5% to 1.9% in accuracy score. While these results alone do not set a new state-of-the-art, the advances of OP-LSTM are orthogonal to other advances in the field of meta-learning, yield new insights in how LSTM work in image classification, allowing for a whole range of new research directions. For reproducibility purposes, we publish all our research code publicly.

## 원문 인용

Mike Huisman, Thomas M. Moerland, Aske Plaat, Jan N. van Rijn (2023). Are LSTMs Good Few-Shot Learners?. arXiv:2310.14139v1. https://arxiv.org/abs/2310.14139v1

**BibTeX**

```
@misc{huisman2023lstms,
  title = {{Are LSTMs Good Few-Shot Learners?}},
  author = {Mike Huisman and Thomas M. Moerland and Aske Plaat and Jan N. van Rijn},
  year = {2023},
  eprint = {2310.14139},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.14139v1}
}
```

## 이 논문의 용어

- [average pooling](https://refivu.com/terms/bb8b271e18a3-average-pooling)
- [support set](https://refivu.com/terms/6ca07dac69e7-support-set)

## 다른 논문 해설

- [Interference Suppression Using Deep Learning: Current Approaches and Open Challenges](https://refivu.com/papers/d2a57af3-38e7-49c3-87be-5847146a2a33-interference-suppression-using-deep-learning-current.md)
- [Deep Learning Methods for Fingerprint-Based Indoor Positioning: A Review](https://refivu.com/papers/47426ccc-0b5f-427b-a7d6-5a8867eb667d-deep-learning-methods-for-fingerprint-based-indoor.md)
- [Predicting Intensive Care Unit Length of Stay and Mortality Using Patient Vital Signs: Machine Learning Model Development and Validation](https://refivu.com/papers/cd289830-8841-4aa7-87d5-c8d6632a76a0-predicting-intensive-care-unit-length-of-stay-and.md)
- [One-step regression and classification with crosspoint resistive memory arrays](https://refivu.com/papers/3d9de6a9-144e-4dd9-bf46-2e45035031ef-one-step-regression-and-classification-with-crosspoint.md)
- [Predictive Modeling of ICU Healthcare-Associated Infections from Imbalanced Data. Using Ensembles and a Clustering-Based Undersampling Approach](https://refivu.com/papers/e7aec497-f033-4be0-bf84-d708340481ca-predictive-modeling-of-icu-healthcare-associated-infections.md)
- [A Perspective on Explainable Artificial Intelligence Methods: SHAP and LIME](https://refivu.com/papers/419ea828-55f0-4840-8bb1-a99a036efbe5-a-perspective-on-explainable-artificial-intelligence-methods.md)
- [Efficient and practical quantum compiler towards multi-qubit systems with deep reinforcement learning](https://refivu.com/papers/f3b3c8a5-f92c-492e-8767-2b01944c00d3-efficient-and-practical-quantum-compiler-towards-multi-qubit.md)
- [Reinforcement Learning for Safe Autonomous Two Device Navigation of Cerebral Vessels in Mechanical Thrombectomy](https://refivu.com/papers/46d473c4-132b-4492-b1f5-3c80a980ac3c-reinforcement-learning-for-safe-autonomous-two-device.md)
- [Data Assimilation in Chaotic Systems Using Deep Reinforcement Learning](https://refivu.com/papers/ed912d09-179c-4d9f-b9e8-03fb289eb4be-data-assimilation-in-chaotic-systems-using-deep.md)
- [Risk-Sensitive Reinforcement Learning with Exponential Criteria](https://refivu.com/papers/9fd0a8d2-af59-4086-8c24-415c54dc21f6-risk-sensitive-reinforcement-learning-with-exponential.md)
- [Training Value-Aligned Reinforcement Learning Agents Using a Normative Prior](https://refivu.com/papers/b77603ca-279d-40d9-a2b6-7ec40a3e3f14-training-value-aligned-reinforcement-learning-agents-using-a.md)
- [Reinforcement learning pulses for transmon qubit entangling gates](https://refivu.com/papers/02967625-3a66-40bd-a3cf-3852c84f8a03-reinforcement-learning-pulses-for-transmon-qubit-entangling.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/0a87600e-7980-43d0-8cc2-239df6e89170-are-lstms-good-few-shot-learners)
