# Testing of Deep Reinforcement Learning Agents with Surrogate Models

대리 모델을 활용한 심층 강화학습 에이전트의 테스트

Matteo Biagiola, Paolo Tonella · arXiv · 2023년 5월 22일

- **연구 문제** 심층 강화학습 에이전트는 무작위로 생성된 환경 구성으로 테스트될 때 실패를 드러내기 어렵고 계산 비용이 큽니다.
- **연구 방법** 훈련 중 실패와 비실패 데이터로 대리 분류기를 학습하고, 그 실패 예측을 적합도로 삼아 환경 구성을 탐색합니다.
- **주요 결과** Indago는 샘플링 접근법보다 50% 더 많은 실패 환경 구성을 찾고, 입력 다양성은 평균 78%, 출력 다양성은 평균 74% 높다고 보고합니다.

## DRL 에이전트 테스트의 어려움

심층 강화학습(DRL) 에이전트는 자율주행과 로봇처럼 실제 상황으로 확장되고 있지만, 이를 테스트하는 방법은 아직 충분히 연구되지 않았습니다. 현재 실무에서는 환경 구성을 무작위로 생성해 에이전트를 실행하는 방식이 주로 쓰입니다. 그러나 무작위 생성은 실패를 드러내기 어렵고, 도전적인 환경 구성을 찾으려면 많은 실행이 필요해 계산 비용이 큽니다.

이 논문은 훈련 과정에서 이미 생성되는 상호작용 데이터에 주목합니다. 훈련 중 실패한 환경 구성은 훈련이 끝난 에이전트에게도 취약한 조건을 대표할 수 있다는 직관에서 출발합니다. 저자들은 이 데이터를 활용해 테스트 시점에 실패 가능성이 높은 환경 구성을 찾는 방법을 제안합니다.

![Table 5: Comparison between training failures (i.e., train. fail.) and failures found by the best Indago settings (i.e., hcsal+fail and gasal+fail). The compar…](https://refivu.com/papers/b9f9c32e-7ede-45a1-a80d-b03a52ef4ca4/figures/figure-de745f84410085c8c69e834240cd5ae5.png?thumb=512)

**Table 5** . Comparison between training failures (i.e., train. fail.) and failures found by the best Indago settings (i.e., hcsal+fail and gasal+fail). The comparison is in terms of number of failures, input/output diversity measured by cluster coverage or entropy and Gini purity coefficient. Values represent the average among ten runs. Bold faced values indicate a statistically significant difference. Underlined values indicate a large effect size.

[원문](https://arxiv.org/abs/2305.12751v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Matteo Biagiola, Paolo Tonella · Testing of Deep Reinforcement Learning Agents with Surrogate Models · 원문 그림 인용 · 원본 PDF 26쪽에서 그림 영역을 추출했습니다.

## 대리 모델과 실패 탐색

제안 방법 Indago는 훈련 상호작용 데이터의 쌍 (e\_i, c\_i)를 사용해 실패(c\_i=1)와 비실패(c\_i=0)를 분류하는 대리 모델을 학습합니다. 이 분류기는 테스트 시점에 DRL 에이전트를 실제로 실행하지 않고도 새 환경 구성의 실패 예측을 출력하는 역할을 합니다. 실패 예측값은 탐색의 적합도 함수가 되며, 탐색은 이 값을 최대화하는 환경 구성을 찾습니다.

탐색 알고리즘은 Hill Climbing과 Genetic Algorithm 두 가지를 사용합니다. Hill Climbing은 현재 해의 이웃을 변이하여 더 높은 실패 예측을 가진 이웃을 선택하는 지역 탐색입니다. Genetic Algorithm은 개체군, 선택, 교차, 변이, 엘리트 보존을 사용합니다. 교차는 두 환경 구성의 매개변수 목록을 절단점에서 교환하는 단일점 교차로 구현됩니다.

변이 방식은 무작위 매개변수를 고르는 방식과 saliency 기법으로 고른 매개변수를 바꾸는 방식이 있습니다. saliency 방법은 분류기 출력에 대한 입력 기울기의 절댓값으로 영향력이 큰 매개변수를 찾고, 기울기 부호에 따라 변화 방향을 정합니다. 변이 결과는 해당 과제의 유효성 제약을 만족할 때만 적용됩니다.

## 비교 설정과 평가 조건

평가는 Parking, Humanoid, Driving 세 과제에서 수행되었습니다. Parking은 HighwayEnv 기반 주차 과제이고, Humanoid는 MuJoCo 기반 보행 과제이며, Driving은 DonkeyCar 기반 자율주행 과제입니다. 각 과제에서 환경 구성의 표현과 변이 연산은 과제별로 다르게 정의되었습니다.

![Figure 1: An initial configuration of the Parking environment in the HighwayEnv simulator \[37\]. The left-hand side (A) shows how the configuration on the right…](https://refivu.com/papers/b9f9c32e-7ede-45a1-a80d-b03a52ef4ca4/figures/figure-5e04a100ddf608cf8d78dd5e031695d4.png?thumb=512)

**Fig. 1** . An initial configuration of the Parking environment in the HighwayEnv simulator \[37\]. The left-hand side (A) shows how the configuration on the right-hand side (B) is rendered in the environment.

[원문](https://arxiv.org/abs/2305.12751v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Matteo Biagiola, Paolo Tonella · Testing of Deep Reinforcement Learning Agents with Surrogate Models · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.

주요 비교군은 무작위 기준선과 샘플링 접근법입니다. 샘플링 접근법은 많은 환경 구성을 무작위로 만든 뒤 분류기 예측이 가장 높은 구성을 고릅니다. 각 사례 연구에서 T=100개의 환경 구성을 생성했으며, Humanoid와 Driving은 구성당 10회 실행하여 실패 확률이 0.5를 넘는 경우를 실패로 간주했습니다. 실패 수 차이는 Mann-Whitney U 검정과 Vargha-Delaney 효과 크기로 확인했습니다. 다양성은 k-means 군집의 커버리지와 엔트로피로 측정했습니다.

훈련 실패 재생 실험(RQ4)에서는 훈련 시드가 테스트 시점에 효과적이지 않은 상황을 다루며, 이때는 회귀기 기반 대리 모델을 사용했습니다. 이는 과제별 연속값 정의를 필요로 하는 설정입니다.

## 실패 수와 다양성 결과

논문은 Indago가 샘플링 접근법보다 50% 더 많은 실패 환경 구성을 찾는다고 보고합니다. 또한 Indago가 찾은 실패는 샘플링보다 입력 다양성이 평균 78% 높고, 출력 다양성이 평균 74% 높습니다. 이 수치는 세 과제의 평균적 비교이며, 과제와 설정에 따라 차이가 있습니다.

![Table 4: Number of failures and input/output diversity measured by cluster coverage or entropy. Values represent the average among ten runs. Bold faced values…](https://refivu.com/papers/b9f9c32e-7ede-45a1-a80d-b03a52ef4ca4/figures/figure-e75942b4c7d2021f3ab53d3effdb8882.png?thumb=512)

**Table 4** . Number of failures and input/output diversity measured by cluster coverage or entropy. Values represent the average among ten runs. Bold faced values indicate a statistically significant difference between Indago and the best of the two baselines. Underlined values indicate a large effect size. We indicate with a bar the setting of Indago using the fitness-based surrogate model, i.e., hcsal+rnd

[원문](https://arxiv.org/abs/2305.12751v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Matteo Biagiola, Paolo Tonella · Testing of Deep Reinforcement Learning Agents with Surrogate Models · 원문 그림 인용 · 원본 PDF 23쪽에서 그림 영역을 추출했습니다.

Parking에서는 gasal+fail 설정이 가장 많은 실패를 찾았지만, 다양성 면에서는 hcsal+fail이 샘플링보다 높은 커버리지와 엔트로피를 보였습니다. Humanoid에서는 여러 Indago 설정이 샘플링보다 유의하게 많은 실패를 찾았습니다. Driving에서는 gasal+fail과 hcsal+fail이 샘플링보다 많은 실패를 찾았습니다.

![Table 2: Number of failures and input/output diversity measured by cluster coverage or entropy. Values represent the average among ten runs. Bold faced values…](https://refivu.com/papers/b9f9c32e-7ede-45a1-a80d-b03a52ef4ca4/figures/figure-adfe9abf347d0a08c658633e92c0e6d8.png?thumb=512)

**Table 2** . Number of failures and input/output diversity measured by cluster coverage or entropy. Values represent the average among ten runs. Bold faced values indicate a statistically significant difference between Indago and sampling. Underlined values indicate a large effect size.

[원문](https://arxiv.org/abs/2305.12751v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Matteo Biagiola, Paolo Tonella · Testing of Deep Reinforcement Learning Agents with Surrogate Models · 원문 그림 인용 · 원본 PDF 20쪽에서 그림 영역을 추출했습니다.

하이퍼파라미터 분석에서는 saliency 기반 변이와 실패 시드를 사용하는 설정이 유리했습니다. 탐색 알고리즘 중에서는 Hill Climbing이 더 다양한 실패를 만들었고, Genetic Algorithm은 실패 수 측면에서 강점을 보였습니다.

![Table 3: Impact of the seed strategy. In each row, the three case studies (Parking / Humanoid / Driving) are separated by a forward slash “/” symbol. An “F” sy…](https://refivu.com/papers/b9f9c32e-7ede-45a1-a80d-b03a52ef4ca4/figures/figure-53775efd55c57fe50c9bbdb6208937b4.png?thumb=512)

**Table 3** . Impact of the seed strategy. In each row, the three case studies (Parking / Humanoid / Driving) are separated by a forward slash “/” symbol. An “F” symbol indicates a statistically significant difference in favor of the approach with the failure seed; a dash “-’ symbol indicates that the two approaches are indistinguishable and an “R” symbol (missing in the table) would indicate a statistically significant difference in favor of the approach with the random seed. As for the comparisons in the first two research questions, we compute statistical significance using the Mann-Whitney U Test.

[원문](https://arxiv.org/abs/2305.12751v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Matteo Biagiola, Paolo Tonella · Testing of Deep Reinforcement Learning Agents with Surrogate Models · 원문 그림 인용 · 원본 PDF 22쪽에서 그림 영역을 추출했습니다.

## 회귀기와 적용 범위의 한계

회귀기 기반 대리 모델은 훈련 실패가 적거나 효과적이지 않은 상황에서 쓰였습니다. 이 방식은 연속값으로 에피소드의 도전성을 표현하지만, 과제마다 그 값을 정의하려면 도메인 지식이 필요합니다. 예를 들어 Parking은 에피소드 길이, Humanoid는 로봇 높이의 최소 거리, Driving은 최대 교차 트랙 오차를 사용했습니다.

또한 결과는 세 가지 사례 연구와 특정 DRL 에이전트 설정에서 얻은 것입니다. 실제 배포 환경이나 다른 에이전트, 다른 과제에서 같은 효과가 유지되는지는 이 논문의 범위를 넘습니다.

## 논문 정보

- **저자**: Matteo Biagiola, Paolo Tonella
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2023년 5월 22일
- **등록일**: 2026년 11월 6일
- **수정일**: 2023년 11월 11일
- **버전**: v2
- **arXiv**: 2305.12751
- **DOI**: 10.1145/3631970
- **분류**: cs.SE · cs.AI · cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

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

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

## 초록

Deep Reinforcement Learning (DRL) has received a lot of attention from the research community in recent years. As the technology moves away from game playing to practical contexts, such as autonomous vehicles and robotics, it is crucial to evaluate the quality of DRL agents. In this paper, we propose a search-based approach to test such agents. Our approach, implemented in a tool called Indago, trains a classifier on failure and non-failure environment (i.e., pass) configurations resulting from the DRL training process. The classifier is used at testing time as a surrogate model for the DRL agent execution in the environment, predicting the extent to which a given environment configuration induces a failure of the DRL agent under test. The failure prediction acts as a fitness function, guiding the generation towards failure environment configurations, while saving computation time by deferring the execution of the DRL agent in the environment to those configurations that are more likely to expose failures. Experimental results show that our search-based approach finds 50% more failures of the DRL agent than state-of-the-art techniques. Moreover, such failures are, on average, 78% more diverse; similarly, the behaviors of the DRL agent induced by failure configurations are 74% more diverse.

## 원문 인용

Matteo Biagiola, Paolo Tonella (2023). Testing of Deep Reinforcement Learning Agents with Surrogate Models. arXiv:2305.12751v2. https://doi.org/10.1145/3631970

**BibTeX**

```
@article{biagiola2023testing,
  title = {{Testing of Deep Reinforcement Learning Agents with Surrogate Models}},
  author = {Matteo Biagiola and Paolo Tonella},
  year = {2023},
  eprint = {2305.12751},
  archivePrefix = {arXiv},
  doi = {10.1145/3631970},
  url = {https://arxiv.org/abs/2305.12751v2}
}
```

## 이 논문의 용어

- [t-SNE](https://refivu.com/terms/488ecf7dbbcf-t-sne)
- [multi-layer perceptron](https://refivu.com/terms/835dd4f24c91-multi-layer-perceptron)
- [Genetic Algorithm](https://refivu.com/terms/616f8277da33-genetic-algorithm)
- [Mann-Whitney U test](https://refivu.com/terms/29a676f2e099-mann-whitney-u-test)
- [surrogate model](https://refivu.com/terms/8b85eb44bbd9-surrogate-model)
- [Humanoid](https://refivu.com/terms/1ca8a4cfb61d-humanoid)
- [silhouette analysis](https://refivu.com/terms/c5b4779d30f5-silhouette-analysis)

## 다른 논문 해설

- [DashBot: Insight-Driven Dashboard Generation Based on Deep Reinforcement Learning](https://refivu.com/papers/311fa89e-4d09-438c-b5ce-c1e0a8ebff93-dashbot-insight-driven-dashboard-generation-based-on-deep.md)
- [Physics-informed Dyna-Style Model-Based Deep Reinforcement Learning for Dynamic Control](https://refivu.com/papers/ed839db3-e284-449a-8ce0-d136449cdf16-physics-informed-dyna-style-model-based-deep-reinforcement.md)
- [MUVINE: Multi-stage Virtual Network Embedding in Cloud Data Centers using Reinforcement Learning based Predictions](https://refivu.com/papers/a0ad3b0c-7094-4464-9f9a-987e033df535-muvine-multi-stage-virtual-network-embedding-in-cloud.md)
- [A Survey on Reinforcement Learning Methods in Character Animation](https://refivu.com/papers/166a3a34-fb30-4b70-9a51-5b1737e136a4-a-survey-on-reinforcement-learning-methods-in-character.md)
- [Safe Deployment of Offline Reinforcement Learning via Input Convex Action Correction](https://refivu.com/papers/7f898899-14eb-4d78-85aa-fbae4e19939f-safe-deployment-of-offline-reinforcement-learning-via-input.md)
- [Deep Reinforcement Learning for RIS-aided Multiuser Full-Duplex Secure Communications with Hardware Impairments](https://refivu.com/papers/a7cdf7b0-fc4c-4c25-baee-925c23d3fc3d-deep-reinforcement-learning-for-ris-aided-multiuser-full.md)
- [Crossing the Conversational Chasm: A Primer on Natural Language Processing for Multilingual Task-Oriented Dialogue Systems](https://refivu.com/papers/4979e86c-dd02-40e2-8f23-8a5038d1ea24-crossing-the-conversational-chasm-a-primer-on-natural.md)
- [Large Language Model-Based Uncertainty-Adjusted Label Extraction for Artificial Intelligence Model Development in Upper Extremity Radiography](https://refivu.com/papers/9b222a13-ea6f-4ce3-a329-e7ff28964ff8-large-language-model-based-uncertainty-adjusted-label.md)
- [Multi-objective Feature Selection with Missing Data in Classification](https://refivu.com/papers/80e8e253-79a0-4c8a-a0cd-c746538a10a2-multi-objective-feature-selection-with-missing-data-in.md)
- [Segment Together: A Versatile Paradigm for Semi-Supervised Medical Image Segmentation](https://refivu.com/papers/a8d380b9-ad64-49d7-af9b-9e7860680f59-segment-together-a-versatile-paradigm-for-semi-supervised.md)
- [NL-Augmenter: A Framework for Task-Sensitive Natural Language Augmentation](https://refivu.com/papers/e0fd312c-0e7e-498c-8be2-a03af090c71e-nl-augmenter-a-framework-for-task-sensitive-natural.md)
- [Evaluating Heuristic Search Algorithms in Pathfinding: A Comprehensive Study on Performance Metrics and Domain Parameters](https://refivu.com/papers/f28b2a89-d6e4-43e6-a216-f16439b73a65-evaluating-heuristic-search-algorithms-in-pathfinding-a.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/b9f9c32e-7ede-45a1-a80d-b03a52ef4ca4-testing-of-deep-reinforcement-learning-agents-with-surrogate)
