You wrote:
"I have recently learned that the magma produced at subduction zones
comes from the partial melting of the mantle above the subducting
plate and that very little comes from the plate itself."
It would be interesting you quote the source of that claim, as this still remains unclear (Guo,K. et al, 2022).
The island arcs and the volcanic arcs are far away from the mid-ocean ridge and the plate that subducts has had time to accumulate a large stack of sediments. This source from University of Dallas sugest that, when the plate subducts, the melting of the oceanic crust with sediments becomes one of the source of calc-alkaline and alkaline magmas that crystallize in the surface as felsic rocks. The volcanologist @Jean-Marie Prival doubts however this assertment is true (read comments moved to chat).
There are some studies as this one that points to a mantle source of the andesites and not the slab:
The sum of stratigraphic, geochemical, and isotopic evidence on
Agrigan supports the derivation of calc-alkaline andesite by the
removal of about 75% solids from a high-alumina basalt accompanied by
a process of K and Rb enrichment, such as volatile-transfer.
Considerations of 87Sr/86Sr, 143Nd/144Nd, and 3He/4He isotopic data
indicate that the source region of these parental liquids lies in the mantle, not subducted crust. (Stern, R.J., 1979).
What it is sure is the sediments of the subducted plate are hydrated. When the subducted plate melts the magma is enriched in H2O because of dehydration of the slab, contributing to the explosive eruptions that form stratovolcanoes in both island arcs and volcanic arcs.
H2O also affects the magma differenciation:
Subduction zones (arcs and back-arcs) are major sites for elemental cycling via slab dehydration and subsequent mantle metasomatism and melting; many models have been suggested by researchers to explain these processes. However, the influence of the overriding lithosphere, especially the lower crust, on the generation of back-arc magmas during the early spreading stage remains largely unknown (Guo,K. et al, 2022).
You also wrote:
"This means that mid-ocean ridges, hot spots, and subduction zones all derive their magma directly from the mantle, yet they somehow produce magmas of differing compositions."
Both hot spots and mid-ocean ridges produce basaltic magmas derived from mantle. It is still in debate if the composition of the slab in subduction zones affects the magma that generates the resulting felsic rocks. It might affect residually. What it is sure is that "somehow" is the subducted slab, and more concretaly the H2O accumulated in the sediments that alters the mantle magma differenciation.
A final consideration is the temperature of the mantle varies greatly from 1000° Celsius near its boundary with the crust to 3700° Celsius near its boundary with the core (source). This bring us to the question if this is enough temperature to melt sediments.
- The melting point of radiolaria SiO2 shells is 1.710 °C. The source of the Si enrichment can hardly be the sediments of the slag.
- This paper sugest some CaCO3 shells are preserved even the trench is under the Carbonate Compensation Depth. They migth enrich the magma in Ca, as CaCO3 melting point is 825ºC.
- Sedimentary clays have a melting point between 1250 °C to 1350 °C. They may enrich the magma in elements as Al or K.
-Eichelberger, J.C. Andesites in island arcs and continental margins: Relationship to crustal evolution. Bull Volcanol 41, 480–500 (1978). https://doi.org/10.1007/BF02597382
-Stern, R.J. On the origin of andesite in the northern Mariana Island Arc: Implications from Agrigan. Contr. Mineral. and Petrol. 68, 207–219 (1979). https://doi.org/10.1007/BF00371901
-Kun Guo, Xiaoyuan Wang, Shuai Chen, Luning Shang, Bingquan Liu, Xia Zhang, Zhiqing Lai (2022): "The delamination of lower crust in continental back-arc basin: Evidence from Sr isotope and elemental compositions of plagioclase and clinopyroxene in andesites from Kueishantao, north of Taiwan, China," Lithos, Volumes 416–417, ISSN 0024-4937, https://doi.org/10.1016/j.lithos.2022.106653.