Cross-focus: query and read content can come from different sequences
Self-direction allows for an exchange of information within one sequence, while cross-focus allows one sequence to search for the other.
Learning objectives and first steps2 objectives . 1 first fix
Try to do it after reading
- Explaining cross-focus: mechanisms and premises where queries and readings can come from different sequences
- Positioning the mechanism ' s fault limits with fixed examples
Suggested first
- QKV Shape and Encoder Decoder
Issues and mechanisms
Self-direction allows for an exchange of information within one sequence, while cross-focus allows one sequence to search for the other. In translation, the decoder currently means forming queries, encoder output forming keys and values; A graphic model can also be used to search images for text positions. The key difference is between vector sources and visible ranges, rather than whether a different focus formula has been used.
If the query length is Tq, the source length is Tk and the matching dimension is dk, the fraction matrix is Tq multiplied by Tk, the output length remains Tq. Keys and values must be aligned to the source position, but the query length does not need to be equal to the source length. The causal constraint within the decoder and the source padding are two types of mask, which cannot be copied directly from the attention mask to a rectangular cross-reference.
A concrete example
Synthetic examples take two query positions and three source positions, each two-dimensional and four-dimensional. The fraction shape is two times three, and the line is re-simulated by a matrix of values of three times four, which yields two times four results. If the third source is merely a completed item, both queries should be barred from reading the column. The second query still has access to the first and second sources, and there is no general rule that “the source number is greater than the search number and must be the future”.
Borders and checks
The source may contain an answer, and the evaluation is therefore to confirm whether it is available in the real task. Retrieval of enhanced or multimodule systems also records source versions and resolution methods. Cross-focusing can create linkages but does not guarantee that references to faithfulness or image-area interpretation are correct; These require separate monitoring, labelling and intervention checks. Cache source key should also follow the source version to fail.
A method of verification
Another example of a border is the absence of sources. Whether the model allows empty sources, should return to zero contributions, or should make obvious errors, which need to be stated in the call contract; Undefined values cannot be generated by the homogenization of a line without valid keys. Where sources are cut off, records should also be kept of which locations are removed, avoiding misinterpretation of the lack of evidence as evidence ignored by the model. For images and text-combined sources, the key and value are also guaranteed to follow the same location order and cannot be reconciled solely to equal numbers.
Check understanding
Two inquiries, three sources. Is it possible to produce three?
No, I won't. Each query is weighted by two output lines; The source length controls the number of items per row weight and does not control the number of output queries.
Do you not need mask for cross-focusing?
The source padding, invisible resources or segmental boundaries may still need to be blocked. It is only that these constraints should not mechanically reproduce the causal triangle of the query sequence.
Sources and reconciliations
Definitions, methods and interfaces are available.
- Attention Is All You Need
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.