---
title: greedy
framework: foundationmodels
role: symbol
role_heading: Type Property
path: foundationmodels/generationoptions/samplingmode-swift.struct/greedy
---

# greedy

A sampling mode that always chooses the most likely token.

## Declaration

```swift
static var greedy: GenerationOptions.SamplingMode { get }
```

## Mentioned in

Analyzing images with multimodal prompting

## Discussion

Discussion Using this mode will always result in the same output for a given input. Responses produced with greedy sampling are statistically likely, but may lack the human-like quality and variety of other sampling strategies. note: Sampling modes random(top:seed:) and random(probabilityThreshold:seed:)

## See Also

### Sampling modes

- [random(probabilityThreshold:seed:)](foundationmodels/generationoptions/samplingmode-swift.struct/random(probabilitythreshold:seed:).md)
- [random(top:seed:)](foundationmodels/generationoptions/samplingmode-swift.struct/random(top:seed:).md)
