Speculative Multi-Action Execution
UFO² introduces a new feature called Speculative Multi-Action Execution. This feature allows the agent to bundle several predicted steps into one LLM call, which are then validated live. This approach can lead to up to 51% fewer queries compared to inferring each step separately. The agent will first predict a batch of likely actions and then validate them against the live UIA state in a single shot. We illustrate the speculative multi-action execution in the figure below:
Configuration
To activate the speculative multi-action execution, you need to set ACTION_SEQUENCE
to True
in the config_dev.yaml
file.
ACTION_SEQUENCE: True
References
The implementation of the speculative multi-action execution is located in the ufo/agents/processors/actions.py
file. The following classes are used for the speculative multi-action execution:
Source code in agents/processors/actions.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
after_status
property
Get the status.
Returns: |
|
---|
args
property
Get the arguments.
Returns: |
|
---|
command_string
property
Generate a function call string.
Returns: |
|
---|
control_label
property
Get the control label.
Returns: |
|
---|
control_log
property
writable
Get the control log.
Returns: |
|
---|
control_text
property
Get the control text.
Returns: |
|
---|
function
property
Get the function name.
Returns: |
|
---|
results
property
writable
Get the results.
Returns: |
|
---|
action_flow(puppeteer, control_dict, application_window)
Execute the action flow.
Parameters: |
|
---|
Returns: |
|
---|
Source code in agents/processors/actions.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
|
count_repeat_times(previous_actions)
Get the times of the same action in the previous actions.
Parameters: |
|
---|
Returns: |
|
---|
Source code in agents/processors/actions.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
execute(puppeteer)
Execute the action.
Parameters: |
|
---|
Source code in agents/processors/actions.py
234 235 236 237 238 239 |
|
get_operation_point_list()
Get the operation points of the action.
Returns: |
|
---|
Source code in agents/processors/actions.py
364 365 366 367 368 369 370 371 372 373 374 375 |
|
is_same_action(action_to_compare)
Check whether the two actions are the same.
Parameters: |
|
---|
Returns: |
|
---|
Source code in agents/processors/actions.py
159 160 161 162 163 164 165 166 167 168 169 170 |
|
print_result()
Print the action execution result.
Source code in agents/processors/actions.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
to_dict(previous_actions)
Convert the action to a dictionary.
Parameters: |
|
---|
Returns: |
|
---|
Source code in agents/processors/actions.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
to_string(previous_actions)
Convert the action to a string.
Parameters: |
|
---|
Returns: |
|
---|
Source code in agents/processors/actions.py
211 212 213 214 215 216 217 |
|