-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
cc @lingebeng
Previously, when we selected operators for generation LLM, we got something like below
torch.argsort
torch.nn.Conv3d
torch.ReLU
However, generation LLM only knows which operators it needs to use but doesn't know how to use, causing many invalid generations, such as shape mismatch or incorrect arguments. The root cause of this issue stems from the LLM hallucination.
A more intuitive enhancement is to add some additional context for each operator (such as the op's func signature or their constraint), instructing LLM to combine these operators correctly. We can get this context from API document and save it in https://github.com/NJU-iSE/FUEL/blob/main/data/pytorch_operators.txt.
Finally, generation LLM should accept something like this
torch.argsort(input, dim=-1, descending=False, stable=False) → [Tensor]
**Parameters**
input (Tensor) – the input tensor.
dim (int, optional) – the dimension to sort along
descending (bool, optional) – controls the sorting order (ascending or descending)
stable (bool, optional) – controls the relative order of equivalent elements
**constraint**
Input tensor: may have any shape and contain numeric or boolean values.
dim: must be a valid dimension index within the range [-input.dim(), input.dim() - 1].
Output dtype: always torch.long.
Output shape: identical to the shape of the input tensor.
Behavior:
Each element of the output contains the index that sorts the corresponding slice of input along the specified dimension.
If stable=True, the relative order of equal elements is preserved.
If descending=True, the sorting order is reversed (largest to smallest).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request