View in English

  • Apple Developer
    • 시작하기

    시작하기 탐색

    • 개요
    • 알아보기
    • Apple Developer Program

    알림 받기

    • 최신 뉴스
    • Hello Developer
    • 플랫폼

    플랫폼 탐색

    • Apple 플랫폼
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    피처링

    • 디자인
    • 배포
    • 게임
    • 액세서리
    • 웹
    • 홈
    • CarPlay
    • 기술

    기술 탐색

    • 개요
    • Xcode
    • Swift
    • SwiftUI

    피처링

    • 손쉬운 사용
    • 앱 인텐트
    • Apple Intelligence
    • 게임
    • 머신 러닝 및 AI
    • 보안
    • Xcode Cloud
    • 커뮤니티

    커뮤니티 탐색

    • 개요
    • Apple과의 만남 이벤트
    • 커뮤니티 주도 이벤트
    • 개발자 포럼
    • 오픈 소스

    피처링

    • WWDC
    • Swift Student Challenge
    • 개발자 이야기
    • App Store 어워드
    • Apple 디자인 어워드
    • 문서

    문서 탐색

    • 문서 라이브러리
    • 기술 개요
    • 샘플 코드
    • 휴먼 인터페이스 가이드라인
    • 비디오

    릴리즈 노트

    • 피처링 업데이트
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • 다운로드

    다운로드 탐색

    • 모든 다운로드
    • 운영 체제
    • 애플리케이션
    • 디자인 리소스

    피처링

    • Xcode
    • TestFlight
    • 서체
    • SF Symbols
    • Icon Composer
    • 지원

    지원 탐색

    • 개요
    • 도움말
    • 개발자 포럼
    • 피드백 지원
    • 문의하기

    피처링

    • 계정 도움말
    • 앱 심사 지침
    • App Store Connect 도움말
    • 새로 추가될 요구 사항
    • 계약 및 지침
    • 시스템 상태
  • 빠른 링크

    • 이벤트
    • 뉴스
    • 포럼
    • 샘플 코드
    • 비디오
 

비디오

메뉴 열기 메뉴 닫기
  • 컬렉션
  • 전체 비디오
  • 소개

더 많은 비디오

  • 소개
  • 요약
  • 코드
  • Evaluations 프레임워크 만나 보기

    Evaluations 프레임워크를 사용하여 모델 기반 경험을 평가하는 방법을 알아보세요. 확률적인 세상에서는 유닛 테스트만으로는 충분하지 않습니다. 지표를 정의하고, 결과물을 자동으로 평가하며, 통계를 집계하여 AI 기반 기능이 Apple 플랫폼 전반에서 안정적으로 동작하도록 하는 방법을 알아보세요.

    챕터

    • 0:00 - Introduction
    • 3:10 - Demo app Book Tacker: a manual evaluation
    • 4:31 - Building your first evaluation
    • 8:06 - Running the evaluation and reading the report
    • 10:57 - Building robust datasets
    • 14:20 - Refining metrics and evaluators
    • 15:41 - Evaluation-driven development and hill-climbing
    • 16:12 - Model judges: qualitative metrics
    • 18:42 - Building a model judge
    • 21:19 - Refining with score dimensions
    • 23:45 - Reviewing dimension results
    • 24:20 - Best practices
    • 25:38 - Next steps

    리소스

    • Book Tracker: Using Evaluations to evaluate an intelligent feature
    • Designing datasets to test your feature
    • Designing effective evaluations
    • Evaluating language model responses
      • HD 비디오
      • SD 비디오
  • 비디오 검색…
    • 4:54 - Define an Evaluation

      // Evaluations
        import Evaluations
      
        struct BookTaggingEvaluation: Evaluation {
        
        }
    • 8:02 - Run with Swift Testing and an optimization target

      // Optimization Target
        @Test("Book Tag Evaluations", .evaluates(evaluation, info: evaluationInfo))
        func evaluateBookTagging() async throws {
            let result = EvaluationContext.current.result
        
            let rangeMetric = BookTagEvaluationTests.evaluation.tagCount
            #expect(result.aggregateValue(.mean(of: rangeMetric)) >= 0.8)
        }
    • 10:09 - Constrain output with a Generable @Guide

      // BookTags.swift
        @Generable
        struct BookTags: Codable {
            @Guide(description: "Descriptive tags capturing themes, genres, moods, and topics from the summary", .count(3...8))
            var tags: [String]
        } snippet.
    • 11:15 - Define the dataset with ModelSample

      // BookTaggingEvaluation
        var dataset = ArrayLoader(samples: [
            ModelSample(prompt: "okay I am OBSESSED and I need everyone to read this RIGHT NOW...",
                        expected: BookTags(tags: ["classic", "romance", "wit", "regency"])),
      
            ModelSample(prompt: "Read this in one sitting between midnight and 4am and I cannot...",
                        expected: BookTags(tags: ["classic", "gothic", "horror", "vampire", "suspense"])),
        ])
        
        // Or load your whole library:
        var dataset = ArrayLoader(samples:
            Book.sampleBooks.map { book in
                ModelSample(prompt: book.review, expected: BookTags(tags: book.tags))
            }
        )
    • 12:53 - Synthesize more samples with a SampleGenerator

      // Synthesizing more inputs
        let samples: [ModelSample<String>] = [
            ModelSample(prompt: "The largest planet in our solar system...", expected: "Jupiter."),
            ModelSample(prompt: "The capital of Thailand...", expected: "Bangkok."),
            ModelSample(prompt: "Swift is...", expected: "a powerful programming language."),
            ModelSample(prompt: "All those moments will be lost in time...", expected: "Like tears in rain.")
        ]
        
        for try await sample in samples.makeSamples(
            """
            Generate diverse sentence completions about the listed topics:
              - The Solar System
              - World Capitals 
            """,
            targetCount: 1000) {
                samples.append(sample)
        }
    • 14:02 - More evaluators: word count and genre

      let wordCount = Metric("WordCount")
      
        Evaluator { _, subject in
            for tag in subject.value.tags {
                if tag.contains(" ") {
                    return wordCount.failing(rationale: "Tag \(tag) contains multiple words")
                }
            }
            return wordCount.passing()
        }
      
        let hasGenreTag = Metric("HasGenreTag")
        
        Evaluator { _, subject in
            let tags = subject.value.tags.map { $0.lowercased() }
            let knownGenres = await BookTaggingService.knownGenres
            for tag in tags {
                if knownGenres.contains(tag) {
                    return hasGenreTag.passing(rationale: "Matched \(tag)")
                }
            }
            return hasGenreTag.failing() 
        }
    • 14:03 - Define a Metric and Evaluator

      let tagCount = Metric("TagCount")
      
        var evaluators: Evaluators {
      
            // Tag count is within the required 3–8 range
            Evaluator { _, subject in 
                let count = subject.value.tags.count
                if (count >= 3 && count <= 8) {
                    return tagCount.passing(rationale: "\(count) tags")
                } 
                return tagCount.failing(rationale: "Got \(count) tags, expected 3–8")
            }
        }
    • 14:27 - Aggregate metrics across samples

      let tagCount = Metric("TagCount")
        let tagTotal = Metric("TagTotal")
        
        func aggregateMetrics(using aggregator: inout MetricsAggregator) {
            aggregator.computeMean(of: tagCount)
            aggregator.group("Distribution of Tag Totals") { aggregator in
                aggregator.computeStandardDeviation(of: tagTotal)
                aggregator.computeMean(of: tagTotal)
                aggregator.computeVariance(of: tagTotal)
            }
        }
    • 15:33 - Iterate the feature's instructions (hill-climbing)

      // BookTaggingService.swift
        let instructions = Instructions {
            """
            You are a librarian and literary analyst. Given a reader's
            freeform summary of a book they read — describing their
            thoughts, feelings, and what stood out — generate a set of
            descriptive tags reflected in the summary.
      
            Rules:
             - Return between 3 and 8 tags.
             - Tags should be lowercase, concise (single word or hyphenated), and descriptive.
             - Tags should include the book's genre, chosen from the included list of known genres.
        
            Known Genres:
             - \(Self.knownGenres.joined(separator: ", "))
            """
        }
    • 18:53 - Build a model judge

      ModelJudgeEvaluator(
            "TagQuality",
            scale: .numeric([
                4: "Tags are relevant and helpful for browsing",
                3: "Mostly relevant, one tag too vague or generic",
                2: "Several tags are wrong or generic",
                1: "Unhelpful or irrelevant"
            ]),   
            judge: PrivateCloudComputeLanguageModel()
        )
    • 22:17 - Split into score dimensions

      // BookTaggingEvaluation.swift
        ScoreDimension(
            "Relevance",
            description: """
                Whether each tag describes a quality, theme, or tone
                of the book itself rather than incidental details or
                the reader's personal reactions.
                """,
            scale: .numeric([
                4: "Every tag describes the book itself",
                3: "Most tags describe the book",
                2: "Some tags describe personal reactions",
                1: "Tags don't meaningfully describe the book"
            ])    
        )
        // Define `usefulness` the same way as a second ScoreDimension.
    • 22:32 - Add dimensions to the judge

      // BookTaggingEvaluation.swift
        var evaluators: Evaluators {
      
            Evaluator {  }  
      
            Evaluator {  }
      
            Evaluator {  }
        
            ModelJudgeEvaluator(
                judge: PrivateCloudComputeLanguageModel(),
                dimensions: [relevance, usefulness]
            )
        }
    • 23:17 - Add app context with a ModelJudgePrompt

      // BookTaggingEvaluation.swift
        ModelJudgeEvaluator(
            judge: PrivateCloudComputeLanguageModel(),
            dimensions: [relevance, usefulness],
            prompt: ModelJudgePrompt( 
                instructions: """
                    You are evaluating tags generated for a personal book-tracking app where users
                    organize their library by browsing and filtering tags.
                    """,
                evaluationTarget: { value in
                    "\(value.tags.count) Generated tags: " + value.tags.joined(separator: ", ")
                },
                reference: { input, _ in 
                    let expectedTags = input.expected?.tags.joined(separator: ", ")
                    return ["Expected Tags": expectedTags ?? "No expected tags defined"]
                }
            )
        )
    • 0:00 - Introduction
    • Rob Rhyne and Yada introduce the Evaluations framework. Generative-AI features break the "same input, same output" contract that unit tests rely on, so a new, more robust form of testing is needed to measure how often features produce unexpected or unsafe results.

    • 3:10 - Demo app Book Tacker: a manual evaluation
    • Introduces the Book Tracker demo app and its BookTaggingService, which auto-tags books from reviews. Trying it in a #playground surfaces issues (too many tags, book title as a tag, multi-word tags) and produces a first human-judged list of expectations.

    • 4:31 - Building your first evaluation
    • Implement the Evaluation protocol in five steps: define the subject (the code under test), the dataset of ModelSample inputs with expected values, a Metric and Evaluator (pass/fail on tag count), and an aggregateMetrics summary.

    • 8:06 - Running the evaluation and reading the report
    • Run evaluations through Swift Testing with the evaluates trait and an optimization target (#expect average at least 80%). The new evaluation test report breaks down per-sample results, prompts, measurements, and the full model response.

    • 10:57 - Building robust datasets
    • Two samples aren't enough; good datasets have thousands with variety (genres, review lengths, fiction/non-fiction, forms, personal opinions). Hand-authoring doesn't scale, so the framework's SampleGenerator synthesizes more samples from a seed set.

    • 14:20 - Refining metrics and evaluators
    • Add metrics for deeper insight: TagTotal with a scoring (not pass/fail) evaluator, range-compliance and distribution, word-count, and genre checks against knownGenres, covering three of the five original expectations, tracked alongside instruction changes.

    • 15:41 - Evaluation-driven development and hill-climbing
    • Recap the loop: a failing optimization target prompts analysis and a change (adding a count range to the @Guide on the BookTags Generable). Re-running to check the result is hill-climbing; centering development on it is evaluation-driven development.

    • 16:12 - Model judges: qualitative metrics
    • Quantitative metrics can pass while tags are still wrong (reader opinions, mis-inferred genres). A model judge uses a second, at-least-as-capable model (here, Private Cloud Compute) to score output the way a person would, consistently across the dataset.

    • 18:42 - Building a model judge
    • A ModelJudgeEvaluator is just another Evaluator producing the same Metric type. Define a TagQuality metric on a 1-to-4 scale (an even number of levels avoids a neutral default), specify the judge model, run it, and read the rationales.

    • 21:19 - Refining with score dimensions
    • When you disagree with a score, the question is often too broad. Split it into ScoreDimensions (Relevance vs. Usefulness), each with its own description and scale, and add a ModelJudgePrompt to give the judge context about your app.

    • 23:45 - Reviewing dimension results
    • Re-running yields separate relevance and usefulness scores whose rationales split the diagnosis: relevance shows what kind of tag is wrong, usefulness shows how it fails at browsing, giving a clear path back into the hill-climbing loop.

    • 24:20 - Best practices
    • Start small (20 to 30 focused samples), use heuristics for quantitative traits (if you can measure it in code), use ModelJudgeEvaluator for qualitative ones, start simple with the judge, and let rationales drive the next change.

    • 25:38 - Next steps
    • Pointers to the Evaluations framework documentation, the Shelf sample code, and the companion sessions on hill-climbing prompts and creating robust evaluations for agentic apps.

Developer Footer

  • 비디오
  • WWDC26
  • Evaluations 프레임워크 만나 보기
  • 메뉴 열기 메뉴 닫기
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    메뉴 열기 메뉴 닫기
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    메뉴 열기 메뉴 닫기
    • 손쉬운 사용
    • 액세서리
    • Apple Intelligence
    • 앱 확장 프로그램
    • App Store
    • 오디오 및 비디오(영문)
    • 증강 현실
    • 디자인
    • 배포
    • 교육
    • 서체(영문)
    • 게임
    • 건강 및 피트니스
    • 앱 내 구입
    • 현지화
    • 지도 및 위치
    • 머신 러닝 및 AI
    • 오픈 소스(영문)
    • 보안
    • Safari 및 웹(영문)
    메뉴 열기 메뉴 닫기
    • 문서(영문)
    • 튜토리얼
    • 다운로드
    • 포럼(영문)
    • 비디오
    메뉴 열기 메뉴 닫기
    • 지원 문서
    • 문의하기
    • 버그 보고
    • 시스템 상태(영문)
    메뉴 열기 메뉴 닫기
    • Apple Developer
    • App Store Connect
    • 인증서, 식별자 및 프로파일(영문)
    • 피드백 지원
    메뉴 열기 메뉴 닫기
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program(영문)
    • Mini Apps Partner Program
    • News Partner Program(영문)
    • Video Partner Program(영문)
    • Security Bounty Program(영문)
    • Security Research Device Program(영문)
    메뉴 열기 메뉴 닫기
    • Apple과의 만남
    • Apple Developer Center
    • App Store 어워드(영문)
    • Apple 디자인 어워드
    • Apple Developer Academy(영문)
    • WWDC
    최신 뉴스 읽기.
    Apple Developer 앱 받기.
    Copyright © 2026 Apple Inc. 모든 권리 보유.
    약관 개인정보 처리방침 계약 및 지침