Artificial Intelligence & Neural Networks β Introduction to AI and Intelligent Agent, NEC licence examination syllabus (Nepal Engineering Council).
PEAS Description of Agents
A four-item checklist that turns a vague brief into a specifiable problem.
π Where this lives: PEAS is the closest thing AI has to a requirements template, and it does the same job the SRS does in software engineering β it forces the questions that are cheap to answer now and expensive to answer after the system is built. "Build a system to help with medical triage" is not a problem statement. Filling in P, E, A and S turns it into one, and the act of filling it in is where you discover the thing nobody had decided. Search "PEAS task environment specification".
The four components
To design a rational agent you must first specify its TASK
ENVIRONMENT. PEAS is the standard four-part description:
P β PERFORMANCE MEASURE
The criteria by which success is judged. Recall from the
agents topic that this is supplied by the DESIGNER and that
specifying it badly produces perverse behaviour. It is the
first item for a reason: everything else is chosen to serve
it.
E β ENVIRONMENT
What the agent operates in β the world it perceives and
affects, including other agents.
A β ACTUATORS
The means by which the agent acts on the environment. This
defines the ACTION SPACE, and constraining it is the most
reliable way to bound what an agent can do.
S β SENSORS
The means by which the agent perceives. This defines the
PERCEPT SPACE, and it determines what the agent can possibly
know β no amount of cleverness compensates for a missing
sensor.
THE ORDER IS DELIBERATE. Performance measure first, because it
determines what counts as a relevant percept and a useful
action. Designers who start from "what sensors do we have?"
build systems that measure what is easy rather than what
matters.
THE CANONICAL EXAMPLE β an automated taxi driver:
P safe, fast, legal, comfortable trip; maximise profits;
minimise impact on other road users
E roads, other traffic, police, pedestrians, customers,
weather
A steering, accelerator, brake, signal, horn, display,
speech
S cameras, radar, lidar, speedometer, GPS, engine and fuel
sensors, accelerometer, microphone, keyboard
NOTE THE PERFORMANCE MEASURE'S INTERNAL CONFLICT: safe and
fast oppose each other, as do profit and minimising impact on
others. THE MEASURE MUST ENCODE THE TRADE-OFF, and this is the
same conflicting-non-functional-requirements problem the
architecture topic described. A measure listing conflicting
goals without weights has not finished the job.
MORE PEAS DESCRIPTIONS, worth knowing as exam material:
MEDICAL DIAGNOSIS SYSTEM
P healthy patient, reduced costs, minimised lawsuits
E patient, hospital, staff
A display of questions, tests, diagnoses, treatments,
referrals
S keyboard entry of symptoms, findings, patient's answers
SATELLITE IMAGE ANALYSIS
P correct categorisation of terrain
E orbiting satellite, downlink, weather
A display of scene categorisation
S colour pixel arrays
PART-PICKING ROBOT
P percentage of parts in the correct bins
E conveyor belt with parts, bins
A jointed arm and hand
S camera, joint angle sensors
REFINERY CONTROLLER
P purity, yield, safety
E refinery, raw materials, operators
A valves, pumps, heaters, stirrers, displays
S temperature, pressure, flow, chemical sensors
INTERACTIVE ENGLISH TUTOR
P student's score on a test
E set of students, testing agency
A display of exercises, corrections, suggestions
S keyboard entry, student's answers
LOOK AT THE ENGLISH TUTOR'S PERFORMANCE MEASURE and apply the
warning from the agents topic: "student's score on a test" is
gameable. An agent optimising it will teach to the test, drill
question formats rather than English, and may discover that
easier tests raise scores. THE HONEST MEASURE β actual language
competence β is harder to observe, which is exactly why the
gameable proxy gets chosen.
A full worked PEAS, with the discoveries it forces
SPECIFY an agent that recommends which topic a student should
study next β the running example from the agents topic, now done
properly.
ββ P: PERFORMANCE MEASURE βββββββββββββββββββββββββββββββββββ
THE REAL GOAL: the student passes the exam with the highest
achievable mark.
MEASURABLE FORM: expected exam mark, approximated by
Ξ£ over topics [ exam_weight(topic)
Γ P(recalled at exam date | study history) ]
minus a penalty for study time, since the student's time is
finite.
REJECTED CANDIDATES, and why β this is the valuable part:
β "topics ticked" β rewards short easy topics
β "recommendations followed" β rewards recommending what
is easiest to accept
β "hours studied" β rewards keeping the student
working, not learning
β "articles read to 100%" β rewards scrolling, which is
a measure the agent can
influence without teaching
anything
EACH REJECTED MEASURE IS A MEASURE THE AGENT COULD SATISFY
WITHOUT DOING THE JOB. Finding four of them in one afternoon
is normal, and is the argument for doing this exercise.
ββ E: ENVIRONMENT βββββββββββββββββββββββββββββββββββββββββββ
the student (whose knowledge state is HIDDEN and can only be
inferred) Β· the syllabus of 519 topics with exam weights Β·
the exam date Β· the calendar (available study time) Β· the
student's device
PROPERTIES (from the environment types topic):
partially observable β the agent sees ticks and reading
depth, never comprehension
stochastic β the student may or may not study, and may
forget at an individual rate
sequential β today's recommendation changes tomorrow's
state
dynamic β the exam approaches whether the agent acts or not
single-agent Β· discrete Β· known rules
ββ A: ACTUATORS βββββββββββββββββββββββββββββββββββββββββββββ
display a recommended topic with a reason Β· display a
revision prompt Β· display "nothing due β rest" Β· reorder the
subject list Β· send a notification
DELIBERATELY EXCLUDED, and the exclusions are the design:
β marking a topic complete on the student's behalf β that
is the student's claim about their own knowledge, and an
agent asserting it corrupts the very data the agent
learns from
β changing the exam date
β hiding topics from the syllabus
CONSTRAINING THE ACTION SPACE IS THE AUTONOMY/PREDICTABILITY
MITIGATION from the properties topic, applied concretely: an
agent that cannot mark topics complete will never find a
clever reason to.
ββ S: SENSORS βββββββββββββββββββββββββββββββββββββββββββββββ
which topics are ticked and when Β· reading depth and time per
article (the ReadingProgress data) Β· notes written Β· the exam
date Β· which recommendations were shown and whether they were
acted on
WHAT THE AGENT CANNOT SENSE, and this is the limiting fact:
whether the student UNDERSTOOD anything. Ticking a topic
and reading it to the end are proxies for comprehension,
and a student can do both while learning nothing.
THE DESIGN CONSEQUENCE: because comprehension is unobservable,
the agent's model is necessarily uncertain, which is why the
performance measure is stated as a PROBABILITY of recall
rather than a fact. A SENSOR THAT DOES NOT EXIST CANNOT BE
COMPENSATED FOR BY A BETTER ALGORITHM β the honest response
is to add a sensor (a self-test, a quick quiz) rather than to
infer harder.
WHAT THE EXERCISE PRODUCED:
one measurable objective, with four rejected alternatives on
record
six environment properties, which determine the agent
structure needed
five actuators and three explicit exclusions with reasons
five sensors and one named blind spot with its consequence
NONE OF IT REQUIRED CODE, and every item would otherwise have
been decided implicitly. THAT IS WHAT PEAS IS FOR.
Using PEAS well
THE COMMON MISTAKES, each with the correction:
STARTING WITH SENSORS INSTEAD OF THE MEASURE
"We have this data, what can we do with it?" produces a
system that optimises whatever the available data measures.
Start from what success means, then ask what you would need
to sense in order to tell.
A PERFORMANCE MEASURE THE AGENT CAN INFLUENCE DIRECTLY
Any measure the agent can move without doing the work will
be moved that way. Measure the ENVIRONMENT'S state, not the
agent's report of it β Goodhart's law, again.
CONFUSING ACTUATORS WITH CAPABILITIES
"Actuators: machine learning" is not an actuator. An
actuator is a means of ACTING ON THE ENVIRONMENT β a
display, a motor, a message sent, a record written.
LEAVING THE ENVIRONMENT VAGUE
"The environment: the internet" tells you nothing. The
useful description names what the agent perceives and
affects, and includes the OTHER AGENTS β because their
presence changes the problem from optimisation to game
theory.
OMITTING THE ADVERSARIAL PART OF THE ENVIRONMENT
A spam filter's environment includes SPAMMERS WHO ADAPT. A
fraud detector's includes fraudsters who probe it. Modelling
these as static noise rather than as responsive agents is
why such systems degrade: the environment is not merely
dynamic, it is dynamic BECAUSE OF THE AGENT'S OWN ACTIONS.
NOT WRITING DOWN THE EXCLUSIONS
The actions an agent may NOT take are often the most
important part of the specification, and they are the part
that never gets recorded unless the template asks for them.
PEAS AND THE REST OF THE DESIGN β how the four items propagate:
P determines whether a goal-based agent suffices or a
UTILITY function is needed. A measure with a single binary
criterion permits a goal-based agent; a measure trading
off several dimensions requires utilities.
E determines the required agent STRUCTURE. Partially
observable β the agent needs internal state, so a simple
reflex agent is ruled out. Stochastic β it must handle
uncertainty. Multi-agent β it may need to model others.
A bounds the SEARCH SPACE β the branching factor of every
search algorithm in ACtE0902 is the number of applicable
actions.
S bounds what is KNOWABLE, and therefore what the agent's
state estimate can possibly contain.
SO PEAS IS NOT A FORM TO FILL IN AND FILE. Each item constrains
the design that follows, which is why it comes first β the same
relationship the requirements have to architecture in the
software engineering unit.
The blind spot in the worked example is the honest lesson: the agent cannot sense whether the student understood anything, only that they ticked and scrolled. A sensor that does not exist cannot be compensated for by a better algorithm β the right response is to add one (a quick self-test), not to infer harder from proxies.
π Go further: the adversarial-environment point deserves its own study, because it breaks a core assumption of machine learning. In adversarial machine learning the environment contains an opponent who observes your system and adapts β spammers testing filters, fraudsters probing thresholds, attackers crafting inputs that flip a classification. Ordinary training assumes the data distribution is fixed; here it changes in response to your model, so a model that is accurate on today's data is a target tomorrow. The countermeasures β adversarial training, ensembles, deliberate randomisation, frequent retraining β all amount to treating the environment as a player rather than as weather. Search "adversarial machine learning evasion attacks".
π‘ Exam angle: state what PEAS stands for and define each element; this is a guaranteed question, usually followed by "give the PEAS description of X". Memorise the automated taxi example in full, and be ready to produce one for a medical diagnosis system, a part-picking robot, a refinery controller, an interactive tutor or a satellite image analyser. The strongest answers note that the performance measure comes first because it determines the rest, that a measure listing conflicting goals must encode the trade-off, and that the actions an agent may not take are part of the specification.